Management Pack Script

SCOM 2012 – Get Alerts From SCOM Group Showing Alert Source Information (Management Pack, Object Path, Monitor / Rule Name etc.)

Well I don’t know why, but I got stuck again to PowerShell. It seams that this language solves many problems in a SCOM operator’s daily work.

I had recently the need for having enriched alert information depending on a certain amount of computers in SCOM. Sounds complicated? Well, I’ll explain it a bit more. I have SQL Server computers monitored with SCOM (of course) and I needed to get the specific alerts from these computers with additional information like from which management pack these alerts are coming from and also what the monitor / rule name is and so on.

Hmm one of my approaches I would like to share here because I think you can use either the entire script or at least parts out of it. I used PowerShell because it is just a blast.

Here we go, the final script looks like this…

image

I added comments to the lines and this should explain pretty much what is going on here.

Mazen Ahmed wrote once how to get the alert rule / monitor related management pack in two manual steps with files. I used some of his approach in my code.

If you run the code you will receive PowerShell custom objects with the properties you need. It looks like this for just two of the objects / alerts…

image

I really like the combination of getting the information and creating the custom object in conjunction with SCOM. Just amazing :)…

Ok there is one downside, the performance of the script is not really well and it is not usable for groups with a large amount of computers. BUT I think here it is a good source for adapting, learning and small environments. It might help you in some way…

Download the script here on Skydrive.

2 Replies to “SCOM 2012 – Get Alerts From SCOM Group Showing Alert Source Information (Management Pack, Object Path, Monitor / Rule Name etc.)

  1. Hi,

    I want the same Script in Powershell Grid widget.
    to get the alerts in the particular group…
    can you help me on this?
    Thank you

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.