AKA: Microsoft.Windows.FilteredRegistryDiscoveryProvider
This is the third post in the new VSAE Fragment category. The provider is used to discover a class type and its properties by reading keys and values from the Windows registry.
What does it do?
This particular fragment can be used to discover the class type discuss here. It demonstrates how to discover different types of properties: Integer, String, and Double (or decimal).
<ManagementPackFragment SchemaVersion="2.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Monitoring>
<Discoveries>
<Discovery ID="SCOMskills.Demo.FilteredRegistry.Discovery" Target="Windows!Microsoft.Windows.Computer" Remotable="true" Enabled="true">
<Category>Discovery</Category>
<DiscoveryTypes>
<DiscoveryClass TypeID="SCOMskills.Demo.FilteredRegistry.Class">
<Property PropertyID="IntegerProperty"/>
<Property PropertyID="StringProperty"/>
<Property PropertyID="DoubleProperty"/>
<Property TypeID="System!System.Entity" PropertyID="DisplayName"/>
</DiscoveryClass>
</DiscoveryTypes>
<DataSource ID="DS" TypeID="Windows!Microsoft.Windows.FilteredRegistryDiscoveryProvider">
<ComputerName>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
<RegistryAttributeDefinitions>
<!--===============================================================================-->
<!--Define registry keys, values, and types. -->
<!--Path and attribute types: http://msdn.microsoft.com/en-us/library/jj130492.aspx-->
<!--===============================================================================-->
<RegistryAttributeDefinition>
<AttributeName>SCOMskillsKeyExists</AttributeName>
<Path>SOFTWARE\SCOMskills</Path>
<PathType>0</PathType>
<AttributeType>0</AttributeType>
</RegistryAttributeDefinition>
<RegistryAttributeDefinition>
<AttributeName>IntegerValue</AttributeName>
<Path>SOFTWARE\SCOMskills\Integer</Path>
<PathType>1</PathType>
<!--reg_dword, any integer value-->
<AttributeType>2</AttributeType>
</RegistryAttributeDefinition>
<RegistryAttributeDefinition>
<AttributeName>StringValue</AttributeName>
<Path>SOFTWARE\SCOMskills\String</Path>
<PathType>1</PathType>
<!--reg string-->
<AttributeType>1</AttributeType>
</RegistryAttributeDefinition>
<RegistryAttributeDefinition>
<AttributeName>DoubleValue</AttributeName>
<Path>SOFTWARE\SCOMskills\Double</Path>
<PathType>1</PathType>
<!--reg string, value can be a double or integer-->
<AttributeType>3</AttributeType>
</RegistryAttributeDefinition>
</RegistryAttributeDefinitions>
<Frequency>60</Frequency>
<ClassId>$MPElement[Name="SCOMskills.Demo.FilteredRegistry.Class"]$</ClassId>
<!--========================================-->
<!--Map registry filters to class properties-->
<!--========================================-->
<InstanceSettings>
<Settings>
<Setting>
<Name>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Name>
<Value>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="SCOMskills.Demo.FilteredRegistry.Class"]/IntegerProperty$</Name>
<Value>$Data/Values/IntegerValue$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="SCOMskills.Demo.FilteredRegistry.Class"]/StringProperty$</Name>
<Value>$Data/Values/StringValue$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="SCOMskills.Demo.FilteredRegistry.Class"]/DoubleProperty$</Name>
<Value>$Data/Values/DoubleValue$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="System!System.Entity"]/DisplayName$</Name>
<Value>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/NetbiosComputerName$</Value>
</Setting>
</Settings>
</InstanceSettings>
<!--=========================================================-->
<!--Discover class instance if SCOMskills registry key exists-->
<!--=========================================================-->
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Boolean">Values/SCOMskillsKeyExists</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="Boolean">true</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</DataSource>
</Discovery>
</Discoveries>
</Monitoring>
<LanguagePacks>
<LanguagePack ID="ENU" IsDefault="true">
<!--============================================================-->
<!--Provide friendly display names for elements in this fragment-->
<!--============================================================-->
<DisplayStrings>
<DisplayString ElementID="SCOMskills.Demo.FilteredRegistry.Discovery">
<Name>Filtered registry class discovery.</Name>
</DisplayString>
<DisplayString ElementID="SCOMskills.Demo.FilteredRegistry.Discovery" SubElementID="DS">
<Name>Filtered registry discovery data source</Name>
</DisplayString>
</DisplayStrings>
</LanguagePack>
</LanguagePacks>
</ManagementPackFragment>
Can you post screenshot of your registry key structure?