Group population - VSAE

I have a custom application which has a back end SQL database.

I’ve created a custom class and discovered the application seed and have also discovered a number properties, including the custom application’s back end database name, database instance name and the SQL Server hosting computer.

The database supporting the application may not necessarily be located on the same server where the application is installed, so could be a remote SQL server instance hosting the database.

What i’m looking to do is, using the SQL related properties I’ve discovered from the custom application, populate a group with the required database class instances be it SQL 2012, 2014, 2016 databases…etc of the custom application back end database.

Any recommendations / example of how to tackle this would be greatly appreciated.

Thanks

1 Like

When deailing with groups I found this URL helpful:

http://blog.scomskills.com/create-a-computer-or-instance-group/

 

I’ve created a group that contains all SQL instances which are hosted on TMG servers.

CLASS Defintion:
<ClassType ID="ABC.Various.Groups.Microsoft.SQLExpress.Instances.TMG" Base="InstanceGroup!Microsoft.SystemCenter.InstanceGroup" Accessibility="Public" Abstract="false" Hosted="false" Singleton="true" Comment="SQL Express DBs used by Microsoft TMG." />

GROUP Discovery:

  <RuleId>$MPElement$</RuleId>
  <GroupInstanceId>$Target/Id$</GroupInstanceId>
  <MembershipRules>
    <MembershipRule>
      <MonitoringClass>$MPElement[Name="SQL!Microsoft.SQLServer.DBEngine"]$</MonitoringClass>
      <RelationshipClass>$MPElement[Name="InstanceGroup!Microsoft.SystemCenter.InstanceGroupContainsEntities"]$</RelationshipClass>
      <Expression>
        <And>
          <Expression>
            <SimpleExpression>
              <ValueExpression>
                <Property>$MPElement[Name="SQL!Microsoft.SQLServer.DBEngine"]/Edition$</Property>
              </ValueExpression>
              <Operator>Equal</Operator>
              <ValueExpression>
                <Value>Express Edition</Value>
              </ValueExpression>
            </SimpleExpression>
          </Expression>
          <Expression>
            <RegExExpression>
              <ValueExpression>
                <Property>$MPElement[Name="SQL!Microsoft.SQLServer.DBEngine"]/ConnectionString$</Property>
              </ValueExpression>
              <Operator>MatchesRegularExpression</Operator>
              <Pattern>^[a-zA-Z]{5}VMFW[0-9]{3}.[a-zA-Z0-9]{1,}$</Pattern>
            </RegExExpression>
          </Expression>
        </And>
      </Expression>
    </MembershipRule>
  </MembershipRules>

Hope it helps.

1 Like