Link to home
Start Free TrialLog in
Avatar of cefranklin
cefranklinFlag for United States of America

asked on

SCOM 2007 R2 Authoring Console: Custom Application Properties... How Do I Populate Them?

I am using SCOM 2007 R2 Authoring Console to create a custom management pack for an application.

Using the console, I simulate object discovery and it works just fine.  My question is, during discovery I am grabbing values from the registry such as a LocationCode and InstallType.  I am getting the data back but, how do I populate this data into the CustomProperties of my discovered object.

So, here is what I get back from the discovery:

- <DataItems>
- <DataItem type="MOM.RegistryData" time="2012-11-14T12:55:40.0293426-05:00" sourceHealthServiceId="53EBADA5-5FB4-6FDC-2B4F-7E214D1B47D8">
- <Values>
  <InstallType VariantType="8">A</InstallType> 
  <IsInstalled VariantType="11" Type="Boolean">true</IsInstalled> 
  <LocationCode VariantType="8">Location1</LocationCode> 
  </Values>
  </DataItem>
  </DataItems>

Open in new window


On my custom application I have a propery called "LocationCode" as the key property set to a string and I ahve the "InstallType" property, also a string.

I am using  this but, I think it's incorrect?

$Data/Property[@Name='Application.LocationCode']$

Open in new window


Here is the part of the XML MP that I am scrutinizing:

<ClassId>$MPElement[Name="Application.Installation"]$</ClassId>
  <InstanceSettings>
    <Settings>
      <Setting>
        <Name>$MPElement[Name="Application.Installation"]/Application.LocationCode$</Name>
        <Value>$Data/Property[@Name='Application.LocationCode']$</Value>
      </Setting>
      <Setting>
        <Name>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Name>
        <Value>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Value>
      </Setting>
      <Setting>
        <Name>$MPElement[Name="Application.Installation"]/Application.InstallationType$</Name>
        <Value>$Data/Property[@Name='Application.InstallType']$</Value>
      </Setting>
      <Setting>
        <Name>$MPElement[Name="System!System.Entity"]/DisplayName$</Name>
        <Value>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetbiosComputerName$</Value>
      </Setting>
    </Settings>
  </InstanceSettings>

Open in new window


I am noticing that the ClassID is trying to go off the installtype?  I never set that so, do not know why it is trying to map it to that value. It's either an A,B,C or D code.

Here is the full XML if needed:

<Configuration>
  <ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
  <RegistryAttributeDefinitions>
    <RegistryAttributeDefinition>
      <AttributeName>IsInstalled</AttributeName>
      <Path>SOFTWARE\MyApp\Install</Path>
      <PathType>0</PathType>
      <AttributeType>0</AttributeType>
    </RegistryAttributeDefinition>
    <RegistryAttributeDefinition>
      <AttributeName>InstallType</AttributeName>
      <Path>SOFTWARE\MyApp\Install\InstallType</Path>
      <PathType>1</PathType>
      <AttributeType>1</AttributeType>
    </RegistryAttributeDefinition>
    <RegistryAttributeDefinition>
      <AttributeName>LocationCode</AttributeName>
      <Path>SOFTWARE\MyApp\MyAppLocationCode</Path>
      <PathType>1</PathType>
      <AttributeType>1</AttributeType>
    </RegistryAttributeDefinition>
  </RegistryAttributeDefinitions>
  <Frequency>60</Frequency>
  <ClassId>$MPElement[Name="Application.Installation"]$</ClassId>
  <InstanceSettings>
    <Settings>
      <Setting>
        <Name>$MPElement[Name="Application.Installation"]/Application.LocationCode$</Name>
        <Value>$Data/Property[@Name='Application.LocationCode']$</Value>
      </Setting>
      <Setting>
        <Name>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Name>
        <Value>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Value>
      </Setting>
      <Setting>
        <Name>$MPElement[Name="Application.Installation"]/Application.InstallationType$</Name>
        <Value>$Data/Property[@Name='Application.InstallType']$</Value>
      </Setting>
      <Setting>
        <Name>$MPElement[Name="System!System.Entity"]/DisplayName$</Name>
        <Value>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetbiosComputerName$</Value>
      </Setting>
    </Settings>
  </InstanceSettings>
  <Expression>
    <SimpleExpression>
      <ValueExpression>
        <XPathQuery Type="String">Values/IsInstalled</XPathQuery>
      </ValueExpression>
      <Operator>Equal</Operator>
      <ValueExpression>
        <Value Type="String">true</Value>
      </ValueExpression>
    </SimpleExpression>
  </Expression>
</Configuration>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of cefranklin
cefranklin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial