Thursday, August 9, 2012

[OpsMgr 2007R2][OpsMgr 2012] Overrides by type for a specific MP - Report

Jean-Sébastien DUCHÊNE has published one of his very interesting report on 21/7/2012 21:04. You can download the MP here : Overrides by type

The reports provided with System Center Operations Manager (SCOM) may sometimes seem particularly poor in terms of daily operations on the product. Today, I offer a report to list overrides with a view by type for a given Management Pack. This Management Pack is useful when you upgrade Management Packs.



Do not forget to create a datasource targeting to the operational database with security rights necessary to generate the report. This reports works with System Center Operations Manager 2007 R2, System Center 2012 Operations Manager and SQL Server 2008 RTM/R2.
Here is the query:

SELECT DISTINCT MP.MPName 'MP', (CASE WHEN AOV.OverrideType = 'RuleProperty' THEN R.RuleName WHEN AOV.OverrideType = 'MonitorProperty' THEN M.MonitorName WHEN AOV.OverrideType
= 'DiscoveryProperty' THEN D .DiscoveryName WHEN AOV.OverrideType = 'RuleConfiguration' THEN R.RuleName WHEN AOV.OverrideType = 'MonitorConfiguration'
THEN M.MonitorName WHEN AOV.OverrideType = 'DiscoveryConfiguration' THEN D .DiscoveryName END) AS 'NameType', aov.ParentType,
mt.Name AS Context, mt.DisplayName AS ContextDisplayName, mtv.Name AS ContextObject, mtv.DisplayName AS ContextObjectDisplayName,
aov.OverrideableParameterName, aov.Value, aov.Enforced, aov.LastModified, aov.TimeAdded, D.DiscoveryEnabled AS 'Enable_by_default',
MPSTORE.MPFriendlyName AS 'MPSTORED'
FROM AllOverrideView AS aov LEFT OUTER JOIN
Rules AS R WITH (nolock) ON aov.TargetId = R.RuleId LEFT OUTER JOIN
Monitor AS M WITH (nolock) ON aov.TargetId = M.MonitorId LEFT OUTER JOIN
Discovery AS D WITH (nolock) ON aov.TargetId = D.DiscoveryId LEFT OUTER JOIN
ManagementPack AS MP WITH (nolock) ON
(CASE WHEN AOV.OverrideType = 'RuleProperty' THEN R.ManagementPackId WHEN AOV.OverrideType = 'RuleConfiguration' THEN R.ManagementPackId
WHEN AOV.OverrideType = 'MonitorProperty' THEN M.ManagementPackId WHEN AOV.OverrideType = 'MonitorConfiguration' THEN M.ManagementPackId
WHEN AOV.OverrideType = 'DiscoveryProperty' THEN D .ManagementPackId WHEN AOV.OverrideType = 'DiscoveryConfiguration' THEN D .ManagementPackId
END) = MP.ManagementPackId INNER JOIN
ManagementPack AS MPSTORE WITH (nolock) ON MPSTORE.ManagementPackId = aov.ManagementPackId LEFT OUTER JOIN
ManagedTypeView AS mt ON mt.Id = aov.ContextId LEFT OUTER JOIN
ManagedTypeView AS mtv ON mtv.Id = aov.ContextObjectId
WHERE (MP.MPFriendlyName IS NOT NULL) AND (MP.ManagementPackId = @MPId)
ORDER BY 'NameType', MP.MPName

Download Management Pack - Overrides by type Report



source : http://microsofttouch.fr/default/b/js/archive/2012/07/21/scom-2007-un-rapport-donnant-les-overrides-par-type-pour-un-management-pack.aspx



This posting is provided "AS IS" with no warranties.

No comments:

Post a Comment