Best Practice: Monitors should roll up to classes with Public accessibility

 

What does this best practice check for?

All monitors reflect a certain aspect of the health of a specific entity or component. In management pack terms, this means that all monitors target a specific class. As a best practice, all monitors should target classes that have Public accessibility.

Why is it important to follow this best practice? What is the impact of not following this best practice?

Classes that have internal accessibility cannot be customized in any manner that is not coded into the same .mp file as where the class is defined. This means that if our monitors and class definitions are in two separate .mp files, having your classes have Internal accessibility means that your monitors cannot target this class.

Also, this means that the customer cannot customize against these classes – they cannot create their own monitoring functionality that targets an Internalclass, nor can they apply any overrides to an Internal class. This typically results in a lot of customer dissatisfaction, and forces customer to reverse engineer the management pack with Public classes.

How do I fix this in my MP?

Using the Authoring Console:

1.        For all classes that have monitoring, open the Properties dialog. Check that Accessibility is set to Public.

Using XML:

< ClassType ID = " Microsoft.Windows.Server.2008.LogicalDisk" Abstract =" false" Accessibility = " Public" Base =" WindowsServer!Microsoft.Windows.Server.LogicalDisk" Hosted =" true" Singleton =" false" />

 

 

     < UnitMonitor ID = " Microsoft.Windows.Server.2008.LogicalDisk.AvailabilityHealth" Accessibility =" Public" Enabled =" true" Target = " Server2008!Microsoft.Windows.Server.2008.LogicalDisk" ParentMonitorID =" SystemHealth!System.Health.AvailabilityState" Remotable =" true" Priority =" Normal" TypeID =" Microsoft.Windows.Server.2008.LogicalDisk.Monitortype" ConfirmDelivery =" false" >

       < Category > StateCollection </ Category >

     </ UnitMonitor >