Creating Groups of Health Service Watcher Objects based on other Groups


 

It has been a well known requirement for most customers, to be able to Create Groups of Windows Computers that also contain corresponding Health Service Watcher objects.  This was needed for Alert Notification subscriptions so that different teams could receive alert notifications filtered by groups, but also include alerts from the Watcher, such as Heartbeat failure and Computer Unreachable.  There are several articles on this but I will reference a very popular one, on Tims’ site: 

http://www.scom2k7.com/dynamic-computer-groups-that-send-heartbeat-alerts/

Essentially, we needed to add an extra membership rule, to the XML, that would also add any Health Service Watcher objects that have a relationship to the Windows Computer objects already in the group.  We did this with the following XML:

<MembershipRule> <MonitoringClass>$MPElement[Name="SC!Microsoft.SystemCenter.HealthServiceWatcher"]$</MonitoringClass> <RelationshipClass>$MPElement[Name="MicrosoftSystemCenterInstanceGroupLibrary!Microsoft.SystemCenter.InstanceGroupContainsEntities"]$</RelationshipClass> <Expression> <Contains> <MonitoringClass>$MPElement[Name="SC!Microsoft.SystemCenter.HealthService"]$</MonitoringClass> <Expression> <Contained> <MonitoringClass>$MPElement[Name="Windows!Microsoft.Windows.Computer"]$</MonitoringClass> <Expression> <Contained> <MonitoringClass>$Target/Id$</MonitoringClass> </Contained> </Expression> </Contained> </Expression> </Contains> </Expression> </MembershipRule>

However, what if we ONLY want a group of Health Service Watcher objects, and NOT the Windows Computers.  BUT – we wish to based the HSW membership list from another group of Windows Computers.  This is useful if we want to create availability reports for a group of Windows Computers, but need to based the report on the availability of a specific up/down monitor, and not anything related to Windows Computer objects.

Here is a code example of exactly that:

In this sample – we will create a simple group of Windows Computers, that start with the name “DB”.  Then – we will create another group only containing HSW objects, corresponding the SQL computers group.

<ManagementPack ContentReadable="true" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <Manifest> <Identity> <ID>grouptest</ID> <Version>1.0.0.8</Version> </Identity> <Name>grouptest</Name> <References> <Reference Alias="MSCIGL"> <ID>Microsoft.SystemCenter.InstanceGroup.Library</ID> <Version>6.1.7221.0</Version> <PublicKeyToken>31bf3856ad364e35</PublicKeyToken> </Reference> <Reference Alias="SC"> <ID>Microsoft.SystemCenter.Library</ID> <Version>6.1.7221.0</Version> <PublicKeyToken>31bf3856ad364e35</PublicKeyToken> </Reference> <Reference Alias="Windows"> <ID>Microsoft.Windows.Library</ID> <Version>6.1.7221.0</Version> <PublicKeyToken>31bf3856ad364e35</PublicKeyToken> </Reference> <Reference Alias="Health"> <ID>System.Health.Library</ID> <Version>6.1.7221.0</Version> <PublicKeyToken>31bf3856ad364e35</PublicKeyToken> </Reference> <Reference Alias="System"> <ID>System.Library</ID> <Version>6.1.7221.0</Version> <PublicKeyToken>31bf3856ad364e35</PublicKeyToken> </Reference> </References> </Manifest> <TypeDefinitions> <EntityTypes> <ClassTypes> <ClassType ID="grouptest.compgroup" Accessibility="Internal" Abstract="false" Base="SC!Microsoft.SystemCenter.ComputerGroup" Hosted="false" Singleton="true" /> <ClassType ID="grouptest.SQLWatchers" Accessibility="Internal" Abstract="false" Base="MSCIGL!Microsoft.SystemCenter.InstanceGroup" Hosted="false" Singleton="true" /> </ClassTypes> </EntityTypes> </TypeDefinitions> <Monitoring> <Discoveries> <Discovery ID="grouptest.DiscoverSQLServersComputerGroup" Enabled="true" Target="grouptest.compgroup" ConfirmDelivery="true" Remotable="true" Priority="Normal"> <Category>Discovery</Category> <DiscoveryTypes> <DiscoveryRelationship TypeID="SC!Microsoft.SystemCenter.ComputerGroupContainsComputer" /> </DiscoveryTypes> <DataSource ID="GP" TypeID="SC!Microsoft.SystemCenter.GroupPopulator"> <RuleId>$MPElement$</RuleId> <GroupInstanceId>$MPElement[Name="grouptest.compgroup"]$</GroupInstanceId> <MembershipRules> <MembershipRule> <MonitoringClass>$MPElement[Name="Windows!Microsoft.Windows.Computer"]$</MonitoringClass> <RelationshipClass>$MPElement[Name="SC!Microsoft.SystemCenter.ComputerGroupContainsComputer"]$</RelationshipClass> <Expression> <RegExExpression> <ValueExpression> <Property>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Property> </ValueExpression> <Operator>MatchesWildcard</Operator> <Pattern>DB*</Pattern> </RegExExpression> </Expression> </MembershipRule> </MembershipRules> </DataSource> </Discovery> <Discovery ID="grouptest.DiscoverSQLWatchers" Enabled="true" Target="grouptest.SQLWatchers" ConfirmDelivery="true" Remotable="true" Priority="Normal"> <Category>Discovery</Category> <DiscoveryTypes> <DiscoveryRelationship TypeID="MSCIGL!Microsoft.SystemCenter.InstanceGroupContainsEntities" /> </DiscoveryTypes> <DataSource ID="GP" TypeID="SC!Microsoft.SystemCenter.GroupPopulator"> <RuleId>$MPElement$</RuleId> <GroupInstanceId>$MPElement[Name="grouptest.SQLWatchers"]$</GroupInstanceId> <MembershipRules> <MembershipRule> <MonitoringClass>$MPElement[Name="SC!Microsoft.SystemCenter.HealthServiceWatcher"]$</MonitoringClass> <RelationshipClass>$MPElement[Name="MSCIGL!Microsoft.SystemCenter.InstanceGroupContainsEntities"]$</RelationshipClass> <Expression> <Contains> <MonitoringClass>$MPElement[Name="SC!Microsoft.SystemCenter.HealthService"]$</MonitoringClass> <Expression> <Contained> <MonitoringClass>$MPElement[Name="grouptest.compgroup"]$</MonitoringClass> </Contained> </Expression> </Contains> </Expression> </MembershipRule> </MembershipRules> </DataSource> </Discovery> </Discoveries> </Monitoring> <LanguagePacks> <LanguagePack ID="ENU" IsDefault="true"> <DisplayStrings> <DisplayString ElementID="grouptest"> <Name>Group Test</Name> <Description /> </DisplayString> <DisplayString ElementID="grouptest.compgroup"> <Name>SQL Servers Computer Group</Name> </DisplayString> <DisplayString ElementID="grouptest.DiscoverSQLServersComputerGroup"> <Name>Discovery for SQL Servers Computer Group</Name> </DisplayString> <DisplayString ElementID="grouptest.DiscoverSQLWatchers"> <Name>Discovery for SQL Health Service Watchers Group</Name> <Description /> </DisplayString> <DisplayString ElementID="grouptest.SQLWatchers"> <Name>SQL Health Service Watchers Group</Name> </DisplayString> </DisplayStrings> </LanguagePack> </LanguagePacks> </ManagementPack>

 

The key to this is the specific reference of the other group – shown here:

<MembershipRules> <MembershipRule> <MonitoringClass>$MPElement[Name="SC!Microsoft.SystemCenter.HealthServiceWatcher"]$</MonitoringClass> <RelationshipClass>$MPElement[Name="MSCIGL!Microsoft.SystemCenter.InstanceGroupContainsEntities"]$</RelationshipClass> <Expression> <Contains> <MonitoringClass>$MPElement[Name="SC!Microsoft.SystemCenter.HealthService"]$</MonitoringClass> <Expression> <Contained> <MonitoringClass>$MPElement[Name="grouptest.compgroup"]$</MonitoringClass> </Contained> </Expression> </Contains> </Expression> </MembershipRule> </MembershipRules>

Comments (16)

  1. Kevin Holman says:

    @ Yaniv –

    Easy. Create a state view. Scope it to class of Windows Server OS, then filter it by the custom group.

  2. Kevin Holman says:

    @Rupert – yes – I think you are oversimplifying. The customer in this case wanted to specifically create a group of HSW instances ONLY, for the purposes of availability reporting. They did not want computers and HSW’s, hence this example, which is something completely different.

  3. Kevin Holman says:

    Oh, I see. That’s weird – and you are right there must be some relationship that does this. I’d have to play around. It is a pity that our group criteria does not support "anding" of multiple object types instead of the way it is, with only being able
    to select OBJECT (all) or a single specific class.

  4. Rupert S says:

    Am I missing something? Can’t this also be achieved by creating a group with dynamic membership based on server name, for example, that adds both the Computer object and the HSW object?

  5. Frikkie says:

    @Kevin – I would just like to esquire about the code. Is it specifically for the 2012x system or can it be used on 2007 as well?

  6. Yaniv says:

    Hi Kevin. I want to create a group which will have Windows Server Operating System objects (and not the Windows Computer objects) based on OU (Organizational Unit) and their related Health Service Watcher (which I know will have to come from Windows Computer
    objects…). Well I succeeded, but the thing is when I create a new State view based on that group, I see also the Health Service objects.. How can I eliminate them?

    thanks
    Yaniv

  7. Yaniv says:

    @ Kevin :-),

    he he … Yes I know that…

    Maybe I skipped some details: I created a custom group to have Windows Server OS + Health Service Watcher objects. When I go to SCOM Console -> Authoring -> Groups -> MyCustomGroup -> View Members, I get what I asked and that is both, Windows Server OS and
    Health Service Watcher objects. Great. Now, I created new State view and left in "Show data related to:" OBJECT. In "Show data contained in a specific group:" I targeted to MyCustomGroup (which gave me WSOS + HSW objects…). Now I am expecting to see ONLY
    WSOS + HSW objects BUT I see also "Health Service" objects. I want to get rid of the Health Service objects… Is it possible (since there is a relationship defined between HSW and HS classes…) ?

    My apologies for the looooong explaination 🙂

    Thanks
    Yaniv.

  8. Yaniv says:

    Hi Kevin. Do you any new insights here?
    thanks
    Yaniv

  9. Gopal says:

    Hi Kevin, I have created a custom group. I could see the members of the custom group. But when i check for reporting, the custom group is not getting listed. I found that, the group is not listed in DataWarehouse also. Its been a week after creating the
    group. Please help what could have gone wrong and what needs to be done to fix this?

  10. In response to the question by Yaniv – one solution is to use the state view widget in a Dashboard.

    We see the behaviour in the state views as Yaniv has correctly stated the health service rolls up to health service watcher. When we only want to scope on one class then we can scope by "Show data related" to a specific class so as not to see the objects that
    roll up to our class.

    But if we have multiple class types in the group, we can’t scope by multiple classes in the State View. We need to use a dashboard instead and just scope to our group.

  11. Anonymous says:

    The SQL 2014 Management Packs have fundamentally changed the way that SQL Server classes are scoped.

  12. Pavithra says:

    Hi Kevin, We have checked the "Health Service Watcher Group/Microsoft.SystemCenter.AgentWatchersGroup" – group for alert forwarding from SCOM 2012 on the connector. Though this default group is enabled for alert forwarding, not all alerts are forwarding.
    Is there anything that has been missed along with group enabling?

  13. Kevin Holman says:

    Why would you filter anything on that default group?

    If you want HSW alerts – I’d filter for the computer down and HB failure monitors specifically, or the HSW class instance.

  14. Anonymous says:

    SCOM can be quite complicated!
    One of the biggest confusions is around why agents go gray, why you

  15. How can I create one Dynamic SCOM Group that only show members with a specific Health State? For example one group for SQL databases that not show “Health State = Not monitored”.

  16. esky says:

    is it possible to create a group of just temperature sensors ? eg – temp monitor from ups and temp monitor from nas in the same group ?

Skip to main content