Archive | September, 2014

[FIX] Part 2. Fixing the Top n by Performance Widget now the supported way

5 Sep

 

Hi,

In May this year I posted an article on how to fix the top-n widgets. https://michelkamp.wordpress.com/2014/05/27/fix-fixing-the-top-n-by-performance-widget/

This unsupported fix worked great for SCOM 2012 CU1/6 and SCOM 2012 R2 UR1/2.

I don’t know if the SCOM product team has read my blog but it seems they have listened and responded to the community! 😉 Because now, after almost a year, by applying SCOM 2012 Sp1
CU7 or SCOM 2012 R2 Update Rollup 3 it is officially FIXED !!!

Thank you Microsoft SCOM product team for this fix !!

 

Analyze:

 

To verify you open the stored procedure “[sdk].[Microsoft_SystemCenter_Visualization_Library_TopNEntitiesByPerfGet]” from the DWH database.

The part where we had to replace the = by like is now completely rewritten. By using an extra stored procedure “[sdk].[Microsoft_SystemCenter_Visualization_Library_PerformanceCounterListByMultipleManagedEntities]

Let’s look it up:


— Use existing sprocs to narrow down the perf counter instances that are valid for the contained types. Avoids duplicating that logic here.


INSERT
INTO
#ResolvedPerfInstancesTable
(ContainerManagedEntityRowId, ObjectName, CounterName, InstanceName, PerformanceRuleInstanceRowId, ManagedEntityRowId)


EXEC
[sdk].[Microsoft_SystemCenter_Visualization_Library_PerformanceCounterListByMultipleManagedEntities]


@ManagementGroup
=
@ManagementGroup,


@ObjectNamePattern= @ObjectNamePattern,


@CounterNamePattern
=
@CounterNamePattern,


@InstanceNamePattern
=
@InstanceNamePattern

 

Looking into this extra stored procedure gives me the wanted ‘Like’ statement we were waiting for:


— Populate this table with the target types of the matching rules.


INSERT
INTO
#RuleTargetTypesAndTheirBaseTypes


SELECT
RMV.TargetManagedEntityTypeRowId, PR.ObjectName, PR.CounterName, PR.RuleRowId, METMPV.AbstractInd


FROM
vPerformanceRule
PR


JOIN
RuleManagementPackVersion
RMV
ON
RMV.RuleRowId = PR.RuleRowId


AND
EXISTS
(SELECT
ManagementPackVersionRowId
FROM
dbo.ManagementGroupManagementPackVersion
M2


WHERE
M2.ManagementPackVersionRowId = RMV.ManagementPackVersionRowId


AND
M2.LatestVersionInd=1)


JOIN
ManagedEntityTypeManagementPackVersion
METMPV
ON
METMPV.ManagedEntityTypeRowId = RMV.TargetManagedEntityTypeRowId


JOIN
dbo.ManagementGroupManagementPackVersion
MGMPV
ON
MGMPV.ManagementPackVersionRowId = METMPV.ManagementPackVersionRowId


AND
MGMPV.LatestVersionInd=1


AND
MGMPV.ManagementGroupRowId=@MGRowId


WHERE ((PR.ObjectName
LIKE
@ObjectNamePattern)


AND
(PR.CounterName
LIKE
@CounterNamePattern))

 

Solution:

 

You can download the SCOM 2012 SP1 CU7 here http://support.microsoft.com/kb/2965089

And the SCOM 2012 R2 Update Rollup 3 here http://support.microsoft.com/kb/2965445

As always I have the habit to walk on the edge of supported/unsupported scenarios so in case of you are in a situation you can’t apply the complete update package you could (haven’t tested it yet) import only the updated MPs located in the directory:

C:\Program Files\System Center 2012\Operations Manager\Server\Management Packs for Update Rollups

Especially MPs Microsoft.SystemCenter.Visualization.Component.Library.mpb and Microsoft.SystemCenter.Visualization.Library.mpb because they contain the widget fix.

 

So community keep on SCOMMING and making great dashboards!!

Michel Kamp

https://michelkamp.wordpress.com