[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

[BUG] VSAE with a PowerShell $Data parameter

27 May

Hi,

This time for a short post on a ‘possible’ bug i detected in VSAE

Problem:

You create a PowerShell script and want to include this script using the $includeFileContent/<script_name>$ tag.

For example

<ProbeAction
ID=Probe
TypeID=Windows!Microsoft.Windows.PowerShellProbe
RunAs=SystemCenter!Microsoft.SystemCenter.DatabaseWriteActionAccount>

<ScriptName>FixTopNQuery.ps1</ScriptName>

<ScriptBody>$IncludeFileContent/FixTopNQuery.ps1$</ScriptBody>

<TimeoutSeconds>300</TimeoutSeconds>

<StrictErrorHandling>true</StrictErrorHandling>

</ProbeAction>

(Added a screenshot below)

The FixTopNQuery.ps1 is a PS script added to the project as “Embedded Resource”.

Now you compile the project and you get a compile error:

Error    1176    The configuration specified for Module Probe is not valid.

: Incorrect expression specified: $DataSet=New-Object System.Data.DataSet

. Unable to resolve this expression. Check the expression for errors. (Hints: Check for correct character casing (upper case/lower case), mismatched “$” signs, double quotes(“), square brackets “[" or "]“). Here is a sample expression: $Data/EventNumber$

(Path = OpsLogix.IMP.Oracle.Dashboards.Task.FixTopNQuery/Probe)    C:\Program Files (x86)\MSBuild\Microsoft\VSAC\Microsoft.SystemCenter.OperationsManager.targets    255    6    Dashboards

(Added a screenshot below)


Hmmm.. Why ?

 

Analyze

After a lot of error and retry I found out that the problem is in the included powershell script. And exactly in this line below:

$DataSet=New-Object System.Data.DataSet

Hmm I hear you thinking, what’s wrong with this statement? That exactly what I was thinking…. But when I change the parameter name the compile was successful…

 

Solution

Do not start a parameter name with $Data in the powershell script. It looks like it’s a reserved word in VSAE.

 

I will share this issue also with the VSAA product team.

Happy Scomming

Michel Kamp

Joining the Opslogix Dev Team

26 Feb

Hi,

Just a quick note. Since begin February 2014 i changed job. I wanted to do more deep dives into creating System Center add-ons like SCOM Management Packs. So I joined the OpsLogix Dev team. I will be working on the Opslogix released Management packs , for example VMWARE , Oracle and Blackberry.

Right now I have finished an IBM WebSphere MQ MP and I’m now designing the ORACLE RAC monitoring MP. Many other new products will follow in our roadmap. If you need any custom MP or have a need for authoring assistance please let me know.

Let’s do some “Happy Scomming”!

Michel Kamp

http://www.opslogix.com

 

Oracle Monitoring:
http://www.opslogix.com/products/oracle-management-pack

vmware Monitoring:
http://www.opslogix.com/products/vmware-intelligent-management-pack

Blackberry Monitoring:
http://www.opslogix.com/products/blackberry-management-pack

 

Reading out PS NoteProperty’s

6 Nov

 

Case:

How do i read out the IsManagementServer property on the example below ??

$X= Get-SCOMClass -Name “Microsoft.SystemCenter.ManagementServer” | Get-SCOMMonitoringObject

The output is:

[Microsoft.SystemCenter.HealthService].AuthenticationName : SRV.stateview.nl

[Microsoft.SystemCenter.HealthService].MaximumQueueSize : 104857600

[Microsoft.SystemCenter.HealthService].MaximumSizeOfAllTransferredFiles : (null)

[Microsoft.SystemCenter.HealthService].RequestCompression : True

[Microsoft.SystemCenter.HealthService].CreateListener : True

[Microsoft.SystemCenter.HealthService].Port : 5723

[Microsoft.SystemCenter.HealthService].IsRHS : True

[Microsoft.SystemCenter.HealthService].IsManagementServer : True

 

Now I want to get the IsManagementServer value

$.[Microsoft.SystemCenter.HealthService].IsManagementServer

But it Fails

$.IsManagementServer

But it Fails

How do I read it out ??

Solution:

Running the command below..

$x | GM

pointed out it was a noteproperty

image  

So since its using [] i have to use ” to make a string of it

So the correct syntax would be

$x.’[Microsoft.SystemCenter.HealthService].IsManagementServer’.value

Happy Scomming

Michel Kamp

Starting blogging again

6 Nov

Case:

Maybe you noticed that I didn’t post no more for a couple of month.

Analyze:

Yes I bought a new home. Knipogende emoticon  So I had to renovate it all. It took(and still takes) a lot of time. But I will try to post regular again.

WP_001616 WP_001849image

Solution:

1) do not buy a new home ! it will save you time…

2) stop blogging. …. not a option

3) start again if you have time … hmmm

I prefer #3. Knipogende emoticon

Happy scomming soon

Michel Kamp

Extending HP network devices with CPU and Memory counters

25 May

Hi,

This blog I had prepared a long time ago but never published it. So now it’s the time to do it.  Since we all know that SCOM 2012 has build in network device monitoring we of course want to use it. This works perfectly , except I you are using devices that are not certified by SCOM. In that case you will not get the CPU and memory counter and Fan/PSU states. For example most of the Procurve network devices from HP are left in the dark. So..

The problem

We want to monitor also CPU and Memory usages from HP network devices.

The solution

I will keep it simple and clear. I will demonstrate the steps using VSAE and give you as bonus the MP at the end. I will use VSAE management pack templates just to illustrate the power of it.

The steps will be:

1. [Classes] create the memory and CPU classes

We just simple make use of on the memory and processor classes that are already present in the system center network library. So we create 2 classes based on that:

image

 

2. [Datasources] create the memory and CPU discovery datasources

Now we have to create the datasources for the discovery of the CPU and memory targets

image

The most important is that you set the device key correctly to the parent node. Otherwise the relationship between the new CPU / memory class and the network device node will not be set. And you will not see any CPU / Memory targets. This can sometime be a ‘error and retry’ process.

3. [Discovery's] create discovery’s for the CPU and Memory targets

Now we have the discovery datasource we can create the 2 discovery rules for the CPU and Memory targets. We will use the VSAE discovery templates for this. Just simple add new ‘Discovery’ template and you add the 2 rules below.

image

Create the 2 new discovery’s and specify the correct datasources.

image

You specify the datasources we created above to the correct discovery rule. Fill in the correct OID to match the HP processor and Memory OIDs.

image

If you now import the MP will will see at a HP node the CPU and Memory classes created. So continue the the next step.

4) [Rules] create the memory and CPU collection rules

So now we can make the stuff we wanted to see. The Memory and CPU counters. So we just simple use the add new item ‘Rule (Performance Collection)’ template and make the 2 new rules. We are going to use the already build in performance collection rules for the network nodes.

image

image 

The most important is to specify the correct OID for the Memory and CPU counters at the datasource configuration. See below:

CPU: .1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0
Memory: .1.3.6.1.4.1.11.2.14.11.5.1.1.2.2.1.1.7 and .1.3.6.1.4.1.11.2.14.11.5.1.1.2.2.1.1.5

I am not going to do a deep dive on this. You can just simple reference to the downloadable project source at the end of this post to check the details out.

The results

Now you import the MP and you will see you most wanted performance counters !! Open the Network Summary Dashboards and Node dashboard for the CPU Usage to check it out.

SNAGHTML126f4134

And the ‘free Memory (Percent)’ performance view for the memory usage.

image 

And below the relation ship diagram.

image

The End

The next step could be to add monitors to alert on high Memory or CU usages. I am not going to give you this bonus because its better to get some VSAE practice you self’s… You can do this the same way you did with the collection rules. There is a template for monitors also.

Download VSAE project (for the diehards): http://sdrv.ms/11mkq9j

Download Management Pack example: http://sdrv.ms/11mku8S

Happy Scomming

Michel Kamp

How To fix the 500 Error using Favorite Reports in the SCOM web console.

22 May

First mention this is a non official solution.

The Problem

You have installed SCOM 2012 Sp1 UR2 and have implemented the scom webconsole and reporting service to be running under HTTPS mode. You have created using the native scom console a favorite report and now when you try to open this favorite report in the scom webconsole you get a error 500.

image

image

Analyzing

To see the real error we have to do some web.config changes. So open the web.config file on this location: C:\Program Files\System Center 2012\Operations Manager\WebConsole\MonitoringView

Now we enable the SCOM error logging

image

And to get it displayed on the user page we do

image

Now when you run the favorite report again we get in the webconsole  the real error

image

Okay looks like the reportviewer web component binary dll can’t be found. Hmm but wait wasn’t this a prereq at installation time. So I checked if the 2010 ReportViewer components where installed and yes it was and the dlls where also spotted in the assembly cache. It looks like the webconsole has problems finding the correct version of the Microsoft.ReportViewer.WebForms.dll in the assembly cache.

The Quick non Official Solution

Copy the missing dlls to the correct directory will force the web runtime to first look in this directory for the dlls and then go to the assembly cache. So that’s what i did.

Copy the Microsoft.ReportViewer.WebForms.dll file from the assembly cache to path : C:\Program Files\System Center 2012\Operations Manager\WebConsole\MonitoringView\bin

Come on give me some script to do that ! Okay open PowerShell as admin and run

Copy-Item c:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\10.0.0.0*\*.dll “C:\Program Files\System Center 2012\Operations Manager\WebConsole\MonitoringView\bin”

And now you try to run the favorite report again in the webconsole …

image

… and Yes its working!

The End.

For me this looks  like a bug and I will address this to Microsoft.

Happy Scomming!

Michel Kamp

Follow

Get every new post delivered to your Inbox.

Join 29 other followers