Including SQL Server 2008 Service Pack 2 in the database engine group


This has been a fairly debated topic and I don’t know how I never posted this simple solution I had for quite a long time.

The SQL Server 2008 Management Pack doesn’t include SQL Server 2008 Service Pack 2 instances in its SQL 2008 DB Engine:

SNAGHTMLbed0387

As you can see only SQL versions 10.0 or 10.1 are included while Service Pack 2 is version 10.2.Since the group comes from a sealed management pack you cannot modify it in the UI.

The solution is pretty simple:

  • define a new population rule with the proper versions included
  • disable the old population rule
  • You can do this easily writing a custom MP that defines the new rule:

          <Discovery ID="QND.SQLServer.2008.PopulateSQLServersInstanceGroup" Target="SQL2008!Microsoft.SQLServer.2008.InstanceGroup" Enabled="true">
            <Category>Discovery</Category>
            <DiscoveryTypes>
              <DiscoveryClass TypeID="SQL2008!Microsoft.SQLServer.2008.InstanceGroup" />
            </DiscoveryTypes>
            <DataSource ID="DS" TypeID="SC!Microsoft.SystemCenter.GroupPopulator">
              <RuleId>$MPElement$</RuleId>
              <GroupInstanceId>$Target/Id$</GroupInstanceId>
              <MembershipRules>
                <MembershipRule>
                  <MonitoringClass>$MPElement[Name="SQL2008!Microsoft.SQLServer.2008.DBEngine"]$</MonitoringClass>
                  <RelationshipClass>$MPElement[Name="SQL2008!Microsoft.SQLServer.2008.InstanceGroupContainsDBEngine"]$</RelationshipClass>
                  <Expression>
                    <Or>
                      <Expression>
                        <RegExExpression>
                          <ValueExpression>
                            <Property>$MPElement[Name="SQL!Microsoft.SQLServer.DBEngine"]/Version$</Property>
                          </ValueExpression>
                          <Operator>MatchesWildcard</Operator>
                          <Pattern>10.0.*</Pattern>
                        </RegExExpression>
                      </Expression>
                      <Expression>
                        <RegExExpression>
                          <ValueExpression>
                            <Property>$MPElement[Name="SQL!Microsoft.SQLServer.DBEngine"]/Version$</Property>
                          </ValueExpression>
                          <Operator>MatchesWildcard</Operator>
                          <Pattern>10.1.*</Pattern>
                        </RegExExpression>
                      </Expression>
                      <Expression>
                        <RegExExpression>
                          <ValueExpression>
                            <Property>$MPElement[Name="SQL!Microsoft.SQLServer.DBEngine"]/Version$</Property>
                          </ValueExpression>
                          <Operator>MatchesWildcard</Operator>
                          <Pattern>10.2.*</Pattern>
                        </RegExExpression>
                      </Expression>
                    </Or>
                  </Expression>
                </MembershipRule>
              </MembershipRules>
            </DataSource>
          </Discovery
    >

    And then disables the old discovery rule

     

          <DiscoveryPropertyOverride ID="Progel.SQL2008.PopulateSQLServersInstanceGroup.Override" Context="SQL2008!Microsoft.SQLServer.2008.InstanceGroup" Enforced="false" 
                                     Discovery="SQL2008!Microsoft.SQLServer.2008.PopulateSQLServersInstanceGroup" Property="Enabled">
            <Value>false</Value>
          </DiscoveryPropertyOverride>
    For the lazy ones the management pack can be downloaded from here

    - Daniele

    This posting is provided "AS IS" with no warranties, and confers no rights.

    About these ads
    1. Leave a comment

    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 )

    Twitter picture

    You are commenting using your Twitter account. Log Out / Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out / Change )

    Google+ photo

    You are commenting using your Google+ account. Log Out / Change )

    Connecting to %s

    Follow

    Get every new post delivered to your Inbox.

    Join 277 other followers

    %d bloggers like this: