OpsMgr 2007: More on dynamic groups and health watchers

Burn-iconEarlier this year, I blogged about creating dynamic computer groups and then adding the agent health watcher component dynamically with a bit of code magic. Many things have changed in my OpsMgr environment since then, including my OpsMgr support team, and we have recently had to add a couple of new groups to accomodate some of these changes.

The new support team wasn’t too familiar with this method of dynamic group creation, but it was easy, right, considering we have it documented all over the interwebs, and right here. Well, we picked up something new to watch out for.

So, this is the bit of code that you need to add to facilitate the agent watchers:

    $MPElement[Name=”SystemCenter!Microsoft.SystemCenter.HealthServiceWatcher”]$
    $MPElement[Name=”MicrosoftSystemCenterInstanceGroupLibrary6172210!Microsoft.SystemCenter.InstanceGroupContainsEntities”]$
       
                         
                $MPElement[Name=”SystemCenter!Microsoft.SystemCenter.HealthService”]$
             
                     
                $MPElement[Name=”MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer”]$
         
           
              $Target/Id$
           
         
       
     
   
 

However, this only works if you are using a specific class of Windows Computer, which is referenced by this bit:

$MPElement[Name=”MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer”]$

 

You should see a matching class in the original membership rule in the management pack, that may look something like this (should match highlighted line):

             $MPElement[Name=”Windows!Microsoft.Windows.Computer”]$
              $MPElement[Name=”MicrosoftSystemCenterInstanceGroupLibrary6172210!Microsoft.SystemCenter.InstanceGroupContainsEntities”]$
             
               
                 
                    $MPElement[Name=”Windows!Microsoft.Windows.Computer”]/OrganizationalUnit$
                 
                  Equal
                 
                    OU=Web,OU=Servers,DC=somedomain,DC=somecompany,DC=net
                 
               
             
           

 

And if it doesn’t match (like it doesn’t between the add on and the original rule example), you will receive an error on importing the management pack. Update the monitoring class and Bob’s your uncle.

Open-mouthed smile

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s