Using Computers And Health Service Watchers Groups in a Management Group containing Clusters

It’s very common for OpsMgr administrators to create instance groups contain windows computer objects and the health service watcher objects for these computers so these groups can be used in alert subscriptions for different support teams. There are many articles out there explaining how to create these groups such as:

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

http://blogs.technet.com/b/kevinholman/archive/2014/04/09/creating-groups-of-health-service-watcher-objects-based-on-other-groups.aspx

Please keep in mind, if there are clusters monitored in your environment, and you’d like to include cluster alerts in the subscriptions you’ve setup, these groups do not contain windows clusters so subscriptions will not process some of the cluster alerts. I noticed it last week when I was configuring Alert Update Connectors using such groups, some of the cluster alerts are not processed such as this one:

Cluster Alert

This is because clusters are actually groups.

Class Definition in Windows Cluster Management MP:

image

In Operations console:

image

As you can see each discovered Windows cluster is a group, and it contains all cluster resources:

SNAGHTML66a977a

So in order for the “Computer and Health Service Watcher” instance groups to include clusters, the GroupPopulator in the group discovery data source needs to be updated to include an additional <MemberShipRule> segment. in the example below, I’ve created a group that contains all computers with the NetBIOS name starts with the letter “S”, associated health service watcher objects, and all clusters with the name starts with letter “S” as well:

image

Of course, in order to add highlighted section in the discovery, I also added the Microsoft.Windows.Cluster.Library as a reference (with alias “Cluster”):

image

Here’s the XML code for the group discovery if you want to copy and paste:

  <Monitoring>
    <Discoveries>
      <Discovery ID="Demo.CompAndHSW.Instance.Group.Discovery" Enabled="true" Target="Demo.CompAndHSW.Instance.Group" ConfirmDelivery="false" Remotable="true" Priority="Normal">
        <Category>Discovery</Category>
        <DiscoveryTypes />
        <DataSource ID="DS" TypeID="SC!Microsoft.SystemCenter.GroupPopulator">
          <RuleId>$MPElement$</RuleId>
          <GroupInstanceId>$MPElement[Name="Demo.CompAndHSW.Instance.Group"]$</GroupInstanceId>
          <MembershipRules>
            <MembershipRule>
              <MonitoringClass>$MPElement[Name="Windows!Microsoft.Windows.Computer"]$</MonitoringClass>
              <RelationshipClass>$MPElement[Name="MSIL!Microsoft.SystemCenter.InstanceGroupContainsEntities"]$</RelationshipClass>
              <Expression>
                <RegExExpression>
                  <ValueExpression>
                    <Property>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/NetbiosComputerName$</Property>
                  </ValueExpression>
                  <Operator>MatchesRegularExpression</Operator>
                  <Pattern>^[Ss]</Pattern>
                </RegExExpression>
              </Expression>
            </MembershipRule>
            <MembershipRule>
              <MonitoringClass>$MPElement[Name="SC!Microsoft.SystemCenter.HealthServiceWatcher"]$</MonitoringClass>
              <RelationshipClass>$MPElement[Name="MSIL!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>
            <MembershipRule>
              <MonitoringClass>$MPElement[Name="Cluster!Microsoft.Windows.Cluster"]$</MonitoringClass>
              <RelationshipClass>$MPElement[Name="MSIL!Microsoft.SystemCenter.InstanceGroupContainsEntities"]$</RelationshipClass>
              <Expression>
                <RegExExpression>
                  <ValueExpression>
                    <Property>$MPElement[Name="Cluster!Microsoft.Windows.Cluster"]/Name$</Property>
                  </ValueExpression>
                  <Operator>MatchesRegularExpression</Operator>
                  <Pattern>^[Ss]</Pattern>
                </RegExExpression>
              </Expression>
            </MembershipRule>
          </MembershipRules>
        </DataSource>
      </Discovery>
    </Discoveries>
  </Monitoring>

Once the additional <MembershipRule> segement is added to the GroupPopulator module, all windows clusters will be shown as child groups for both my custom defined group and the “Windows Clusters” group:

SNAGHTML67d6784

Lastly, if you are updating a existing group, don’t forget to change the display name to something like “Computers, Clusters and Health Service Watchers Group” 🙂

8 comments

  1. Hi Tao. 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.. Is it possible to eliminate them from the view?

    1. yes, you should be able to. when creating the state view, choose your OS class in “Show data related to:” field and choose your group in “Show data contained in a specific group:” field.

      1. 🙂 Yes I know that…

        Maybe I skipped some details. I’ll try to make myself clearer here: 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 explanation 🙂

        Thanks
        Yaniv.

  2. Hi Tao,
    I’m using the Group Populator discovery to use Windows Computers from OU, what would be your suggestion for including the cluster objects related to the OU objects, all nodes and cluster names (and AD resource names) are stored in the same OU but cluster objects don’t have the attribute for OU to match my expression.

    Is there a way to link the OU target of the cluster name to the clusters objects in SCOM? your example is very basic matching on name but our clusters vary in names due to previous lack of naming conventions and I’m trying to group clusters by the teams who manage the nodes and resources for alerting purposes.

    Any advice you can give for the Membership rule modification would be really helpful.

    Cheers,
    Grant

Leave a Reply

%d bloggers like this: