Member Health

A couple of posts (1,2) in the newsgroup got my interest recently.

Rollup monitors allow you to set the health of a container object to the worst health of any member, the best health of any member, or the health of the object at some user-defined percentage point in the middle of the distribution.  There is no way to really roll together the health of the contained objects.

Unfortunately, there really is no way to do this natively in OpsMgr today.  You have to look up and aggregate the health "externally" and then plug it back in.

I wrote a management pack to do this, using a Powershell datasource and custom monitortype.  You have to place a Management Pack Reference on the SpecialRollupMonitoring management pack.  You have to use the Authoring Console to create a custom monitor using the

The data source requires

  • $Target/Id$ (hardcoded for you)
  • ClassTypeId
  • RMS (defaults to "." since singleton and DA groups will be on the RMS)

The ClassTypeId is there because a group can contain multiple class types (e.g. computers and network components), but you may want the health of the monitor to only represent computers.  In this case, you would enter

ClassTypeId = $MPElement[Name="Windows!Microsoft.Windows.Computer"]$

RMS is the host computer name of your Root Management Server.  This is needed for the Powershell script that gets the information and compiles it together.

The datasource returns a propertybag with the following properties:

  • ErrorPercentage – The fraction of objects in the group that are in Error state
  • WarningPercentage – The fraction of objects in the group in warning state
  • UnhealthyPercentage – The fraction of objects in the group not in Success state
  • ErrorCount – Raw count of objects in Error state
  • WarningCount – Raw count of objects in Warning state
  • UnhealthyCount – Sum of ErrorCount and WarningCount

The MonitorType compares the PropertyBag results to parameters you feed it.  The parameters you’ll have to provide are

  • IntervalSeconds – how frequently to update the state of the group or container object.
  • ClassTypeId – This is where you put $MPElement[Name="Windows!Microsoft.Windows.Computer"]$ or whatever class you want to be included in the rollup.
  • ErrorPercentageIndicatingDegraded – What fraction of member objects have to be in an Error state for the group state to go Yellow?
  • UnhealthyPercentageIndicatingDegraded – What fraction of member objects have to be in Error or Warning state for the group to go Yellow?
  • ErrorPercentageIndicatingDown – What fraction of member objects have to be in Error state for the group to go Red?
  • UnhealthyPercentageIndicatingDown – What fraction of member objects have to be in Error or Warning state for the group to go Red?

In my testing, I created a Distributed Application and added the objects I wanted to roll up.  I then exported the management pack containing the DA to the Authoring console and created a Custom Unit Monitor targeting the SC_2348789…. group that the DA created.  You could do the same with any group.

Feel free to post comments or questions.  The MP is in the zip file in both sealed and unsealed forms so you can see how it works. 

 

Update (9-May-2009): The script in the MP is flexible, but would be simpler using the GetRelatedPartialMonitoringObjects() method on $Group.  If you don’t need to select the member classtype, you can just replace everything from the "#Next get the class type object" through the line before "$oAPI = New-Object -comobject MOM.ScriptAPI;" with the following one line:

$Group.GetRelatedPartialMonitoringObjects() | % {$MemberObjects ++; if ($_.HealthState -eq "Error") {$ErrorObjects++} elseif ($_.HealthState -eq "Warning") {$WarningObjects++}}

http://cid-f2cbe6bae5bb51e1.skydrive.live.com/embedrowdetail.aspx/Public/SpecialRollupMonitoring.zip

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s