Monday, September 14, 2015

Repost/Cross Post: Dynamic OM12 R2 Groups WITH Heartbeat Alerts

Issue
When creating dynamic Groups containing Windows Servers for instance, you WON’T get an Alert when one of those servers is down. Ouch! When you don’t know that, it’s something which is going to bite you sooner or later.

Cause
There is always a WHY to something and this case isn’t different. YES, SCOM does check on the availability of the monitored Windows Server. Sure. But it does that kind of monitoring on a whole different Class.

As we all know, SCOM is all about Classes. And the Monitors which check for the availability of the Microsoft Monitoring Agent (MMA) and the related Windows Computer are targeted against the Health Service Watcher Class, and not against the Windows (Server) Computer Class:

Health Service Heartbeat Failure Monitor:
image

Computer Not Reachable Monitor:
image

As a result, when creating a dynamic Group in SCOM only containing Windows Server objects, and using this Group in your notification model, you WON’T get an Alert when one of those servers goes down. Sure, other Alerts will do come up, but not an Alert like ‘Health Service Heartbeat Failure’ or ‘Failed to Connect to Computer’, while these Alerts do show you the root cause right away…

What to do about it?
Sure. You can get angry/frustrated with it and go on with your life. However, it’s SCOM remember? So with a bit copying and pasting XML you can achieve a lot!

No! MANUALLY adding the related Health Service Watcher object to this dynamic Group won’t fly. We WANT a dynamic Group remember? A ‘set-and-forget’ Group by knowing this Group will always contain the correct members, AUTOMATICALLY.

So the initial investment will be a bit bigger, but when done, you’re truly done here.

Spoiler
This posting isn’t based on a brain wave I got. But just looking on the internet for the right resources. And after some good searching I found what I needed. At the end of this posting I’ll share the resources I used and give credit to the people who deserve it.

Solution
Easy. Follow these few steps by example and you’ll be fine.

  1. Create a Dynamic Group which is dynamically populated with the Windows Computer objects. E.g: Example Group with this Dynamic Inclusion Rule:
    image
    Basically ALL Windows Computers monitored by SCOM are added automatically to this Dynamic Group.
  2. Checking the members:
    image
    As you see, Windows Computer objects only.
  3. Export the MP containing this Group, open the related XML in Notepad++ (for instance) and add this additional XML code between the tags </MembershipRule> and </MembershipRules>. So you’ve got something like this:
    Add the code where the red arrows point at:
    image

    You got something like this:
    image
  4. Increment the version number so you can differentiate between both versions of this MP. Save the modifications and import this updated version into your SCOM MG.
  5. Check the Group members:
    image
    Yeah!

Caveats
So this REALLY works. However, there are some caveats to reckon with:

  1. Since you edited the underlying XML of this Group you CAN’T edit it anymore in the SCOM Console:
    image 
    The Create/Edit rules button is greyed out AND do you recognize the Query formula? Exactly, it’s the XML code you just added!
  2. The previously mentioned XML code ONLY works for SCOM 2012 R2! When running OM12 SP1 you’ll need to change the version numbers from 7585010 to 7084300.
  3. The modification of the numbers goes for SCOM 2012 RTM. I don’t know the numbers but you can find them in the XML code of the MP, under the header <References>. Look for the Aliases for Microsoft.Windows.Library and Microsoft.SystemCenter.InstanceGroup.Library. Here you’ll find the correct numbers:
    image
  4. Sometimes your MP will use other references ALIASES. So check them in your MP whether they’re correct. When not, adjust the XML code in accordingly:
    image

Used resources
As stated before, this posting came to be by using other resources, in chronological order:

  1. A posting written by Tim McFadden;
  2. A posting written by Jonathan Almquist.;
  3. TechNet Forum for SCOM, thread 01;
  4. TechNet Forum for SCOM, thread 02 (Thanks Marthijn van Rheenen).

So ALL credits for this posting goes to these guys. Thanks men!

No comments: