none
"Dynamic Computer groups that send heartbeat alerts" RRS feed

  • Question

  • I found this article from Tim McFadden which contains XML code to add the health service watcher objects for the associated windows computer objects that are added by dynamic membership.   

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

    Unfortunatly it is not working for me and I believe it may have something to do with the way I am customizing the XML.  I would appreciate any feedback.  In Tim's article he notes: 

    "*Note if you choose another class other than Microsoft.Windows.Computer to create you dynamic group you will have to replace the line from watchers.xml with the matching line in your dynamic group membership rule.  <MonitoringClass>$MPElement[Name="MicrosoftWindowsLibrary6062780!Microsoft.Windows.Computer"]$</MonitoringClass>"

    The class that I am using to create the dynamic group IS something other than the Microsoft.Windows.Computer class.  We extended the Windows Server class and are using that.  Therefore I used the following line in my code.

    "  <MonitoringClass>$MPElement[Name="LFGCustomCommonMPObjectsDiscovery1003!Type21a1201e61ee4c19b99496e3c354f141"]$</MonitoringClass>"

    Does this look right?  The class info looks cryptic, but this is what is referenced in other parts of the code for the group.  I am assuming it is right, but am not 100%.  Below is the XML of my customized version of Tim McFadden's XML code that I am adding.  Can anyone review and offer any reasons why this may not be working?      

    <MembershipRule>
          <MonitoringClass>$MPElement[Name="UINameSpace5955a64fa7a74352b181fa6a402c1b94.Group"]$</MonitoringClass>
          <RelationshipClass>$MPElement[Name="MicrosoftSystemCenterInstanceGroupLibrary6172210!Microsoft.SystemCenter.InstanceGroupContainsEntities"]$</RelationshipClass>
          <IncludeList>
           <MonitoringObjectId>489460fe-2df1-e307-9292-3b9ef4bb6c7e</MonitoringObjectId>
          </IncludeList>
         </MembershipRule>
         <MembershipRule>
          <MonitoringClass>$MPElement[Name="SystemCenter!Microsoft.SystemCenter.HealthServiceWatcher"]$</MonitoringClass>
          <RelationshipClass>$MPElement[Name="MicrosoftSystemCenterInstanceGroupLibrary6172210!Microsoft.SystemCenter.InstanceGroupContainsEntities"]$</RelationshipClass>
          <Expression>
           <Contains>
            <MonitoringClass>$MPElement[Name="SystemCenter!Microsoft.SystemCenter.HealthService"]$</MonitoringClass>
            <Expression>
             <Contained>
              <MonitoringClass>$MPElement[Name="LFGCustomCommonMPObjectsDiscovery1003!Type21a1201e61ee4c19b99496e3c354f141"]$</MonitoringClass>
              <Expression>
               <Contained>
                <MonitoringClass>$Target/Id$</MonitoringClass>
               </Contained>
              </Expression>
             </Contained>
            </Expression>
           </Contains>
          </Expression>
         </MembershipRule>

    For additional information here is another membership rule in my Membership rules xml code block.  You will see the same information of my extended class that I used. 

    <MembershipRule>
                  <MonitoringClass>$MPElement[Name="LFGCustomCommonMPObjectsDiscovery1003!Type21a1201e61ee4c19b99496e3c354f141"]$</MonitoringClass>
                  <RelationshipClass>$MPElement[Name="MicrosoftSystemCenterInstanceGroupLibrary6172210!Microsoft.SystemCenter.InstanceGroupContainsEntities"]$</RelationshipClass>
                  <Expression>
                    <RegExExpression>
                      <ValueExpression>
                        <Property>$MPElement[Name="LFGCustomCommonMPObjectsDiscovery1003!Type21a1201e61ee4c19b99496e3c354f141"]/AttributeDiscoveryGeneratedByUIc964a6e35b5643258e93e925daf9bcdb$</Property>
                      </ValueExpression>
                      <Operator>MatchesRegularExpression</Operator>
                      <Pattern>.*SG01301.*</Pattern>
                    </RegExExpression>
                  </Expression>
                </MembershipRule>

    Thursday, October 21, 2010 8:39 PM

Answers

  • Ok I think I have it straight.  Here is my code that I got to work.  It uses the same logic as Tim McFadden uses, but it adds the cluster objects for the associated Windows Computer objects.

    <MembershipRule>

    <MonitoringClass>$MPElement[Name="Windows1!Microsoft.Windows.Cluster.Component"]$</MonitoringClass>

    <RelationshipClass>$MPElement[Name="MicrosoftSystemCenterInstanceGroupLibrary6172210!Microsoft.SystemCenter.InstanceGroupContainsEntities"]$</RelationshipClass>

    <Expression>

    <Contains>

    <MonitoringClass>$MPElement[Name="Windows1!Microsoft.Windows.Cluster.HostedGroup"]$</MonitoringClass>

    <Expression>

    <Contained>

    <MonitoringClass>$MPElement[Name="MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer"]$</MonitoringClass>

    <Expression>

    <Contained>

    <MonitoringClass>$Target/Id$</MonitoringClass>

    </Contained>

    </Expression>

    </Contained>

    </Expression>

    </Contains>

    </Expression>

    </MembershipRule>

    • Edited by Keithk2 Saturday, November 20, 2010 1:41 AM update
    • Marked as answer by Keithk2 Friday, August 10, 2012 11:14 PM
    Friday, November 19, 2010 11:05 PM
  • I'd have to play around with creating this group with the HSW objects in my lab.  Come to think of it, I've never attempted this with a group of objects other than Windows Computer.  There could be some blocker with doing it this way.  Might have to use a different method, like the one discussed here.

    I don't really have the time to test this now.  If you don't get this answered in the next couple weeks, I'll have a little more time mid-November.


    HTH, Jonathan Almquist - MSFT
    • Marked as answer by Vivian Xing Wednesday, November 3, 2010 2:33 AM
    Wednesday, October 27, 2010 6:55 PM
    Moderator

All replies

    • Proposed as answer by Vivian Xing Monday, October 25, 2010 7:17 AM
    Saturday, October 23, 2010 2:37 AM
    Moderator
  • I reviewed your post.  Did you just add the following code to add the associated Health Service Watcher objects?  Did you change anything else?

    <MembershipRule>
                  <MonitoringClass>$MPElement[Name="SystemCenter!Microsoft.SystemCenter.HealthServiceWatcher"]$</MonitoringClass>
                  <RelationshipClass>$MPElement[Name="Health.Service.Watcher.Group.ComputersStartingWithABC.ClassContainsEntity"]$</RelationshipClass>
                  <Expression>
                    <Contains>
                      <MonitoringClass>$MPElement[Name="SystemCenter!Microsoft.SystemCenter.HealthService"]$</MonitoringClass>
                      <Expression>
                        <Contained>
                          <MonitoringClass>$MPElement[Name="MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer"]$</MonitoringClass>
                          <Expression>
                            <Contained>
                              <MonitoringClass>$Target/Id$</MonitoringClass>
                            </Contained>
                          </Expression>
                        </Contained>
                      </Expression>
                    </Contains>
                  </Expression>
                </MembershipRule>

    Monday, October 25, 2010 3:32 PM
  • Correct.  The first part of the membership rule just populates the group with specific Windows Computer objects.  The second part of the membership rule (what you have pasted above) states any computer objects that are contained in THIS group, also add the associated HSW object.


    HTH, Jonathan Almquist - MSFT
    Monday, October 25, 2010 5:21 PM
    Moderator
  • Ok.  I am pretty sure I have followed your instructions, however it is still not working for me.  Here are all my membership rules.  Does anything stand out as a problem?

    I assume the following is my group reference: 

    <RelationshipClass>$MPElement[Name="MicrosoftSystemCenterInstanceGroupLibrary6172210!Microsoft.SystemCenter.InstanceGroupContainsEntities"]$</RelationshipClass>

     I assume the following is the class I am targeting (your windows Computer class):

    <MonitoringClass>$MPElement[Name="LFGCustomCommonMPObjectsDiscovery1003!Type21a1201e61ee4c19b99496e3c354f141"]$</MonitoringClass>

              <MembershipRules>
                <MembershipRule>
                  <MonitoringClass>$MPElement[Name="LFGCustomCommonMPObjectsDiscovery1003!Type21a1201e61ee4c19b99496e3c354f141"]$</MonitoringClass>
                  <RelationshipClass>$MPElement[Name="MicrosoftSystemCenterInstanceGroupLibrary6172210!Microsoft.SystemCenter.InstanceGroupContainsEntities"]$</RelationshipClass>
                  <Expression>
                    <RegExExpression>
                      <ValueExpression>
                        <Property>$MPElement[Name="LFGCustomCommonMPObjectsDiscovery1003!Type21a1201e61ee4c19b99496e3c354f141"]/AttributeDiscoveryGeneratedByUIc964a6e35b5643258e93e925daf9bcdb$</Property>
                      </ValueExpression>
                      <Operator>MatchesRegularExpression</Operator>
                      <Pattern>.*SG01301.*</Pattern>
                    </RegExExpression>
                  </Expression>
                </MembershipRule>
         <MembershipRule>
          <MonitoringClass>$MPElement[Name="SystemCenter!Microsoft.SystemCenter.HealthServiceWatcher"]$</MonitoringClass>
          <RelationshipClass>$MPElement[Name="MicrosoftSystemCenterInstanceGroupLibrary6172210!Microsoft.SystemCenter.InstanceGroupContainsEntities"]$</RelationshipClass>
          <Expression>
           <Contains>
            <MonitoringClass>$MPElement[Name="SystemCenter!Microsoft.SystemCenter.HealthService"]$</MonitoringClass>
            <Expression>
             <Contained>
              <MonitoringClass>$MPElement[Name="LFGCustomCommonMPObjectsDiscovery1003!Type21a1201e61ee4c19b99496e3c354f141"]$</MonitoringClass>
              <Expression>
               <Contained>
                <MonitoringClass>$Target/Id$</MonitoringClass>
               </Contained>
              </Expression>
             </Contained>
            </Expression>
           </Contains>
          </Expression>     
         </MembershipRule>
              </MembershipRules>

     

     

    Monday, October 25, 2010 7:07 PM
  • Does your group populate with your LFG instances?  Try taking the HSW part out and verify those instances are discovered for the group.  Also consider adding the case insensitive operator to your regular expression pattern, otherwise you might not get desired results.

    Case insensitive syntax:  (?i:sg01301)

    More on expressions here: http://blogs.technet.com/b/jonathanalmquist/archive/2010/10/13/regular-expression-syntax-in-scom-for-filtering-groups-monitor-elements-operational-views-notification-subscriptions-etc.aspx

     


    HTH, Jonathan Almquist - MSFT
    Tuesday, October 26, 2010 3:41 PM
    Moderator
  • Yes the group populates properly with the LFG instances.  When I take out the HSW part out all looks right.  I understand about the case insensitive syntax issue, but this won't be a problem for us according to our processes.
    Wednesday, October 27, 2010 2:24 PM
  • I'd have to play around with creating this group with the HSW objects in my lab.  Come to think of it, I've never attempted this with a group of objects other than Windows Computer.  There could be some blocker with doing it this way.  Might have to use a different method, like the one discussed here.

    I don't really have the time to test this now.  If you don't get this answered in the next couple weeks, I'll have a little more time mid-November.


    HTH, Jonathan Almquist - MSFT
    • Marked as answer by Vivian Xing Wednesday, November 3, 2010 2:33 AM
    Wednesday, October 27, 2010 6:55 PM
    Moderator
  • Jonathan,

    I got it to work.  I needed to update the XML to the R2 version and it worked.  My next challenge will be to include the cluster objects associated with all the computer objects.  Do you have any suggestions on this?

    Woud it look something like this?

    ------------------------------------------------

    <MembershipRule>
          <MonitoringClass>$MPElement[Name="SystemCenter!Microsoft.Windows.Cluster.Component"]$</MonitoringClass>
          <RelationshipClass>$MPElement[Name="MicrosoftSystemCenterInstanceGroupLibrary6172210!Microsoft.SystemCenter.InstanceGroupContainsEntities"]$</RelationshipClass>
          <Expression>
           <Contains>
            <MonitoringClass>$MPElement[Name="SystemCenter!Microsoft.Windows.Cluster.Service"]$</MonitoringClass>
            <Expression>
             <Contained>
              <MonitoringClass>$MPElement[Name="LFGCustomCommonMPObjectsDiscovery1003!Type21a1201e61ee4c19b99496e3c354f141"]$</MonitoringClass>
              <Expression>
               <Contained>
                <MonitoringClass>$Target/Id$</MonitoringClass>
               </Contained>
              </Expression>
             </Contained>
            </Expression>
           </Contains>
          </Expression>     
         </MembershipRule>

    --------------------------------------------

    Keith 

    Tuesday, November 16, 2010 6:56 PM
  • Hi Keith,

    The easiest way to see how this would look would probably be to create the group in the Operations Console and then look at the resultant XML.


    HTH, Jonathan Almquist - MSFT
    Wednesday, November 17, 2010 4:31 AM
    Moderator
  • Thanks Jonathan.  I did that and now I see the monitoring class that I need is

    <MonitoringClass>$MPElement[Name="MicrosoftWindowsClusterManagementLibrary6067200!Microsoft.Windows.Cluster.Component"]$</MonitoringClass>

    Now I want to use the same logic as you used with the Health Service Watcher object code, in that I would like all cluster components for all associated windows computer objects.  Would this be represented between the <expression> and </expression> blocks? 

    In your code you have the following listed...

    Expression>
           <Contains>
            <MonitoringClass>$MPElement[Name="SystemCenter!Microsoft.SystemCenter.HealthService"]$</MonitoringClass>
            <Expression>
             <Contained>
              <MonitoringClass>$MPElement[Name="LFGCustomCommonMPObjectsDiscovery1003!Type21a1201e61ee4c19b99496e3c354f141"]$</MonitoringClass>
              <Expression>
               <Contained>
                <MonitoringClass>$Target/Id$</MonitoringClass>
               </Contained>
              </Expression>
             </Contained>
            </Expression>
           </Contains>
          </Expression>   

    Could you perhaps explain the logic a bit?  Why did you choose SystemCenter!Microsoft.SystemCenter.HealthService and $Target/Id$?

    To translate this in terms of my application I believe I would use SystemCenter!Microsoft.Windows.Cluster.Service and $Target/Id$?

    Am I correct on any of this?

    ---------my entire membership rule---------------

    <MembershipRule>
          <MonitoringClass>$MPElement[Name="MicrosoftWindowsClusterManagementLibrary6067200!Microsoft.Windows.Cluster.Component"]$</MonitoringClass>
          <RelationshipClass>$MPElement[Name="MicrosoftSystemCenterInstanceGroupLibrary6172210!Microsoft.SystemCenter.InstanceGroupContainsEntities"]$</RelationshipClass>
          <Expression>
           <Contains>
            <MonitoringClass>$MPElement[Name="SystemCenter!Microsoft.Windows.Cluster.Service"]$</MonitoringClass>
            <Expression>
             <Contained>
              <MonitoringClass>$MPElement[Name="LFGCustomCommonMPObjectsDiscovery1003!Type21a1201e61ee4c19b99496e3c354f141"]$</MonitoringClass>
              <Expression>
               <Contained>
                <MonitoringClass>$Target/Id$</MonitoringClass>
               </Contained>
              </Expression>
             </Contained>
            </Expression>
           </Contains>
          </Expression>     
         </MembershipRule>

    --------------------------------------------

    When I try to import this it fails.  The RMS logs event ID 26319 which is:

    =================

    Event Type: Error
    Event Source: OpsMgr SDK Service
    Event Category: None
    Event ID: 26319
    Date:  11/18/2010
    Time:  3:31:26 PM
    User:  N/A
    Computer: IN3DWOMRMS01
    Description:
    An exception was thrown while processing ImportManagementPack for session id uuid:87bad271-ee18-422c-88b5-860bb63aef1e;id=127.
     Exception Message: The creator of this fault did not specify a Reason.
     Full Exception: System.ServiceModel.FaultException`1[Microsoft.EnterpriseManagement.Common.ManagementPackException]: The creator of this fault did not specify a Reason. (Fault Detail is equal to : Verification failed with [1] errors:
    -------------------------------------------------------
    Error 1:
    : Failed to verify Discovery [UINameSpace56070014124f4e04ac27561c7d660d70.Group.DiscoveryRule]
    Failed to verify referenced module : ID=GroupPopulationDataSourceInvalid configuration specified for Module [GroupPopulationDataSource]Cannot find MPElement: MicrosoftWindowsClusterManagementLibrary6067200!Microsoft.Windows.Cluster.Group specified in expression: $MPElement[Name="MicrosoftWindowsClusterManagementLibrary6067200!Microsoft.Windows.Cluster.Group"]$Cannot resolve identifier [MicrosoftWindowsClusterManagementLibrary6067200!Microsoft.Windows.Cluster.Group] in the context of ManagementPack [LFG.Custom.Distributed.Database.Systems.Team]. Unknown alias [MicrosoftWindowsClusterManagementLibrary6067200]
    -------------------------------------------------------

    Failed to verify Discovery [UINameSpace56070014124f4e04ac27561c7d660d70.Group.DiscoveryRule]Failed to verify referenced module : ID=GroupPopulati...).

    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

    ====================

    Based upon this event id I am assuming that the MPElement MicrosoftWindowsClusterManagementLibrary6067200!Microsoft.Windows.Cluster.Group cannot be located.  I know I am missing something in my XML code here.

    • Edited by Keithk2 Thursday, November 18, 2010 8:53 PM update
    Wednesday, November 17, 2010 7:07 PM
  • Ok I think I have it straight.  Here is my code that I got to work.  It uses the same logic as Tim McFadden uses, but it adds the cluster objects for the associated Windows Computer objects.

    <MembershipRule>

    <MonitoringClass>$MPElement[Name="Windows1!Microsoft.Windows.Cluster.Component"]$</MonitoringClass>

    <RelationshipClass>$MPElement[Name="MicrosoftSystemCenterInstanceGroupLibrary6172210!Microsoft.SystemCenter.InstanceGroupContainsEntities"]$</RelationshipClass>

    <Expression>

    <Contains>

    <MonitoringClass>$MPElement[Name="Windows1!Microsoft.Windows.Cluster.HostedGroup"]$</MonitoringClass>

    <Expression>

    <Contained>

    <MonitoringClass>$MPElement[Name="MicrosoftWindowsLibrary6172210!Microsoft.Windows.Computer"]$</MonitoringClass>

    <Expression>

    <Contained>

    <MonitoringClass>$Target/Id$</MonitoringClass>

    </Contained>

    </Expression>

    </Contained>

    </Expression>

    </Contains>

    </Expression>

    </MembershipRule>

    • Edited by Keithk2 Saturday, November 20, 2010 1:41 AM update
    • Marked as answer by Keithk2 Friday, August 10, 2012 11:14 PM
    Friday, November 19, 2010 11:05 PM