Dependency Monitor

If you’ve been following the series, you should have two classes and a unit monitor. As discussed earlier in the series, the base class types used are Local Application and Application Component, and these do not automatically rollup health to its hosting class.

If you want unit monitors targeting the application component class to rollup health to its hosting class (local application), you can add a dependency monitor

I prefer to add dependency monitors to the fragment that contains the class in which I want to rollup. So, this fragment is a repeat of the application component class fragment posted earlier, with the exception of including the dependency monitor.

<ManagementPackFragment SchemaVersion="2.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<TypeDefinitions>
<EntityTypes>
<ClassTypes>
<ClassType ID="SCOMskills.Demo.ApplicationComponent.Class" Abstract="false" Accessibility="Public" Base="Windows!Microsoft.Windows.ApplicationComponent" Hosted="true" Singleton="false">
<Property ID="CsvField1" Key="false" Type="string"/>
<Property ID="CsvField2" Key="false" Type="string"/>
</ClassType>
</ClassTypes>
<RelationshipTypes>
<RelationshipType ID="LocalApplicationHostsApplicationComponent" Base="System!System.Hosting" Accessibility="Public">
<Source ID="LocalApplication" Type="SCOMskills.Demo.LocalApplication.Class"/>
<Target ID="ApplicationComponent" Type="SCOMskills.Demo.ApplicationComponent.Class"/>
</RelationshipType>
</RelationshipTypes>
</EntityTypes>
</TypeDefinitions>
<Monitoring>
<Monitors>
<DependencyMonitor ID="ApplicationComponentAvailabilityRollup" Accessibility=“InternalEnabled=“trueMemberMonitor=“Health!System.Health.AvailabilityStateParentMonitorID=“Health!System.Health.AvailabilityStateRelationshipType=“LocalApplicationHostsApplicationComponentPriority=“NormalRemotable=“falseTarget=“SCOMskills.Demo.LocalApplication.Class>
<Category>AvailabilityHealth</Category>
<Algorithm>WorstOf</Algorithm>
</DependencyMonitor>
</Monitors>
</Monitoring>
<LanguagePacks>
<LanguagePack ID="ENU" IsDefault="true">
<DisplayStrings>
<DisplayString ElementID="SCOMskills.Demo.ApplicationComponent.Class">
<Name>SCOMskills Application Component Class</Name>
</DisplayString>
<DisplayString ElementID="SCOMskills.Demo.ApplicationComponent.Class" SubElementID="CsvField1">
<Name>CSV Field 1</Name>
</DisplayString>
<DisplayString ElementID="SCOMskills.Demo.ApplicationComponent.Class" SubElementID="CsvField2">
<Name>CSV Field 2</Name>
</DisplayString>
<DisplayString ElementID="LocalApplicationHostsApplicationComponent">
<Name>Local Application class hosts Application Component class</Name>
</DisplayString>
<DisplayString ElementID="ApplicationComponentAvailabilityRollup">
<Name>Application Component Health</Name>
</DisplayString>
</DisplayStrings>
</LanguagePack>
</LanguagePacks>
</ManagementPackFragment>

Comments welcome (links require moderation)