How to create a custom dependency monitor (Part 1)


 
In this article, we will talk about how you can create your own “custom” dependency monitors for distributed applications with nonstandard rollup method.
Why do we need that?
Operations Manager has limited methods for rolling up the state of monitors from one object to another.  For this purpose, Operations Manager uses combination of Dependency and Aggregate monitors. Aggregate monitors can show the best state or the worst state of underlying monitors. Dependency monitors can also show the best state or the worst state of monitors and as well as calculate the percentage of monitors in the best state:
The Best state
The worst state
clip_image001
clip_image002
 
But if we want different logic for rolling up health?
For example, a distributed application consists of two objects and you need the following:

·        Warning state when only one of the objects is not in healthy state

·        Critical state when both of them are not in healthy state

clip_image004
clip_image006
 
Another example. Say you still have two objects in your distributed application. These objects are monitored using a sealed management pack and you can’t change monitors’ states. But these objects are not critical for you and you want them to rollup Warning state, even if they are Critical:
clip_image007
 
For these cases we have developed two methods which can expand the standard model of health rollup. In the first part we will show how to do that using a script. In the second part we will show you an interesting method based on a native module.
The script works very straightforward. It is basically a regular PowerShell script-based Unit monitor, that analyzes health of distributed application’s objects. Script counts the amount of child objects in warning and critical state, and based on scipt’s configuration – changes the health appropriately. There is a bunch of setting that you can configure, for example, you can use absolute values or percentages when counting objects, or you can even use weights for each object depending on its display name.
There is a sample management pack in the attached file. The monitor is targeted to distributed application class and its components, therefore you will find additional monitor called “Custom Rollup” in the Health Explorer for each distributed application and its components after you have installed this management pack into Operations Manager:
clip_image008
 
The monitor is disabled by default. You have to enable it for each distributed application you want to monitor using this method. Note, that you have to disable the regular dependency monitors that are created by default, otherwise they will also perform health rollup.
You can change logic for each distributed applications separately using overrides.The key overrides are in the table below:
Parameter
Standard value
Eligible values
Description
ErrorHighThreshold
(mandatory)
100
>ErrorLowThreshold
(If Mode = Percentage or Weight
 <100)
The maximum amount (or percent) of objects in DA in Critical state. Once this maximum is reached, the monitor gets Critical
ErrorLowThreshold
(mandatory)
100
>0
(If Mode = Percentage or Weight
 <100)
The maximum amount (or percent) of objects in DA in Critical state. Once this maximum is reached, the monitor gets Warning
Mode
(mandatory)
Absolute
Absolute
Percentage
Weight
Absolute: all thresholds have absolute value.
Percentage: all thresholds have percentage value.
Weight: all thresholds have percentage value using the weight of each object.
WarningHighThreshold
(mandatory)
100
>WarningLowThreshold
(If Mode = Percentage or Weight
 <100)
The maximum amount (or percent) of objects in DA in Warning state. Once this maximum is reached, the monitor gets Critical
WarningLowThreshold
(mandatory)
100
>0
(If Mode = Percentage or Weight
 <100)
The maximum amount (or percent) of objects in DA in Warning state. Once this maximum is reached, the monitor gets Warning
WeightString
 
NAME1,30;NAME2,40;
NAME3,20;NAME4,10;
A string, which sets the weight of each object in the DA. The name of the object has to be equal to Display Name. The total sum of weights has to be less than 100 if the list of objects is not full.
The total sum of weights has to be equal 100 if the list of object is full.
 
Please take into account the following information:

·        The state of monitors is calculated every 5 minutes (by default scripts run each 5 minutes)

·        If Mode parameter is not equal to Absolute, Percentage or Weight, it is set as Absolute (as it doesn’t have a type, it’s just a string)

·        The state of monitors is calculated using the following rules:

       ·        The monitor gets Critical in case when value exceeds ErrorHighThreshold,

               WarningHighThreshold or exceeds WarningLowThreshold and ErrorLowThreshold

               simultaneously.

       ·        The monitor gets Warning in case when value exceeds one of the LowThreshold.

·        If string WeightString sets the weight not for all objects in the DA then the remaining weight is distributed among the others equally.

·        If Mode is set as Weight without WeightString then Mode is changed to Percentage

·        In case when the monitor does not have correct parameters (for example, the thresholds are more than 100% in the Percentage mode; one of the mandatory parameters is missing, etc.) you will get an Alert and event in the Operations Manager log.

 

This method has some drawbacks:

·        The delay of recalculating the state of monitor is equal to the script interval

·        You can observe the high CPU load in case when you use this method for a very big amount of complex distributed applications

·        Health Explorer does not give a clear picture why the monitor changes its state, as the monitor doesn’t expand like a dependency monitor does

 

We appreciate any feedback and comments. Please check out another way of making “custom” dependency monitors.
 
All content provided on this blog is for informational purposes only. Any references and links to other web sites are given for convenience of users. Microsoft cannot guarantee the accuracy or completeness of any information presented on these web sites. The references to external websites doesn’t imply approval of information or solutions provided by such web sites.
 

Custom.DistributedApplications.Library.mp


Comments (0)

Skip to main content