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 Comments

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s