Archive | Widgets RSS feed for this section

[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

Advertisements

[FIX] Fixing the Top n by Performance Widget

27 May

Update!: Fixed the run issue on SCOM 2012 R2 installations in MP version V1.0.0.6 . Thanks community for pointing out to this R2 issue.

Challenge:

First, I really LOVE the dashboard widgets included in SCOM. When making MPs I always deliver dashboards that gives the operator a one shot overview of the monitored targets. The most used and valuable widget for this is the “Objects by performance Widget”

This works perfect EXECPT when you have more instances of a performance value. Let’s say the table space free of table spaces, or disk C: D: ect from windows servers.

The problem is that most of the time you will get the situation below “Empty Widgets”

 

The problem is the Stored Procedure “Microsoft_SystemCenter_Visualization_Library_TopNEntitiesByPerfGet“. I don’t go into details because this issue is a known fact and already reported several times on the community. For example by Cameron Fuller http://blogs.catapultsystems.com/cfuller/archive/2013/06/05/issue-with-the-objects-by-performance-widget-with-and-all-performance-instances-scom-sysctr.aspx

But a fix for this in a SCOM CU was till now never released…. Till now….

 

Analyze

As I mentioned before it’s in the Stored Procedure “Microsoft_SystemCenter_Visualization_Library_TopNEntitiesByPerfGet“. We have a code part that does an exact match on the instance name. If we want to show all instances it will not return any matches. See the yellow parts below.

  •    INSERT
    INTO
    #ResolvedSeriesTable(ManagedEntityRowId, PerformanceRuleInstanceRowId)

                  SELECT
    CET.ContainedEntityRowId, PRI.PerformanceRuleInstanceRowId

                  FROM
    PerformanceRule
    PR

                  JOIN
    PerformanceRuleInstance
    PRI
    ON (PR.RuleRowId = PRI.RuleRowId)

                  JOIN
    #ContainedEntitiesTable
    CET
    ON (1=1)

            WHERE (
    (PR.ObjectName
    =
    @ObjectNamePattern)
    AND

                    (PR.CounterName
    =
    @CounterNamePattern)
    AND

                    (PRI.InstanceName
    =
    @InstanceNamePattern))

Suggestion to fix, is to use a like match. See yellow part.

       INSERT
INTO
#ResolvedSeriesTable(ManagedEntityRowId, PerformanceRuleInstanceRowId)

              SELECT
CET.ContainedEntityRowId, PRI.PerformanceRuleInstanceRowId

              FROM
PerformanceRule
PR

              JOIN
PerformanceRuleInstance
PRI
ON (PR.RuleRowId = PRI.RuleRowId)

              JOIN
#ContainedEntitiesTable
CET
ON (1=1)

        WHERE (
(PR.ObjectName
like
@ObjectNamePattern)
AND

                (PR.CounterName
like
@CounterNamePattern)
AND

                (PRI.InstanceName
like
@InstanceNamePattern))

 

To change this you will need SQL Developer knowledge. And I realize that most of the operators know a lot of backend/frontend products but aren’t developers. So it could be a bit of a challenge to change this stored procedure yourself.

 

Solution

To solve this issue I have created a Management Pack that changes this stored procedure for you. It doesn’t do this automatically, because I want you to choose to do it. So I implemented it as a SCOM task. When you import the MP and go the ManagementServer target that has the property “Is Root Health Service Emulator = True” (you can find it in the view Operations Manager -> Management Server -> Management Servers State) you will see a Task “Task Fix TopNQuery Widget“. Now you execute the task and you will see a Task output below:


And you go to the Widget dashboard you created and what do you see ????

 


Yes a working TopN Widget page.

 

NOTICE!!!

Using this task is totally unsupported. But in my opinion the negative impact is very low compared to the positive impact because this stored procedure is only used for reading data and not changing it so it wouldn’t impact the DB with incorrect data (except for some SQL performance penalty for the use of the like statement).

NOTICE!!!

When you reload the MP Microsoft.SystemCenter.Visualization.Library the stored procedure will be overwritten to the original version. This could happen if you implement an upcoming CU release. If the issue isn’t fixed in this release you must rerun the TASK again.

 

You can download this MP on my personal download site:

https://onedrive.live.com/redir?resid=A6ECD6E173E79D82!6314&authkey=!AE0rJkhRPXOcblI&ithint=file%2c.zip

Happy Scomming

Michel Kamp

Part 2 : Get more value using Visio drill trough

3 Jun

Hi Quick Update. In part 1 I promised when I had time I would make a prototype of a OM 12 Widget that would show a Visio document and update the health states on it.

So , not that I had time but the coolness factor was to high , so I offered some hours on Sunday to get this working… yes you have read it correctly. I have it working !

Mission

Make a OM 2012 widget and load a Visio document in it. Then refresh the shape data according to the OM target health states. Just the way the official Microsoft Visio SCOM plug in it does.

Accompliced

So far I have it working as a prototype. Yes its stable but as every prototype not fool proof. See screen shots below.

SNAGHTML697f596f

The prototype works based on Visio documents you have made with the official Visio SCOM plugin. Just create the Visio document and drag the OM targets on it and save it. Then load it in to the widget , for now with File –> open. There is one rule: You must have Visio installed on the machine running the OM console.

You don’t have to have the official Visio SCOM plugin installed when you only view the Visio sheets in the Widgets. I have made a refresh feature that connects to the OM group and gets the health state data and refreshes the Visio shapes based on the outcome. But when you have the official Visio SCOM plugin installed you get a bonus. It works also in the widget with official refreshing. See screenshot below:

image

After getting a try timeout it shows the login form. Better would be that it takes the credentials you are using running the OM console . But … Again prototype facts.

SNAGHTML69895c3d

Conclusion

Sorry I really love being a nerd! (that’s what my wife says anyway) If you are honest you must admit this is really cool stuff!!. Since it will cost me for now to much time to finish a build I can share and because the VSAE is still under NDA and I maybe have plans with this. I will not share it for now. However I will try to convince the MS OM guys ( Dale , Marcin, Baelson hope you read this) to deliver this widget out of the box..

Happy Scomming and till next week!

Michel Kamp