SCOM 2012: Adding Health States to a State View


Last week I received a question about the possibility to add the health state of services to a state view inside SCOM. This can be done if the service has its own class, if this is not the case the health state cannot be selected on a state view. So for each service a separate class, discovery and monitor need to be created. In this blog I will guide you through that process.

Let’s for example try to combine the health state of a CentOS computer and the state of the SSH service on this CentOS computer. If you look into the Linux/Computer state view you cannot select the health state of the SSH Service. See below the classes which you can select ouf-of-the box:


So basically we have to do the following to make it possible:

  • Create Management Pack with a separate class,discovery and monitor.
  • Select Columns on Stateview

Let’s start with creating a SCOM Management Pack. You could use your preferred XML editor or Visual Studio for creating the MP. For this example MP I use the UNIX/Linux Authoring Library MP which can be downloaded here.  After you downloaded this MP you can use the following guidance to create the references which I also used in my MP. After creating the references we are going to create the class definitions:

<ClassType ID="SSH_TestPack.Class" Base="Unix!Microsoft.Unix.ComputerRole" Accessibility="Public" Abstract="false" Hosted="true" Singleton="false">
<Property ID="RoleName" Type="string" Key="true" />
<ClassType ID="SSH_TestPack.Group" Accessibility="Public" Abstract="false" Base="SC!Microsoft.SystemCenter.ComputerGroup" Hosted="false" Singleton="true" Extension="false" />

In the above class definitions we define a class which has Microsoft.Unix.ComputerRole as a base class and a class for a Instance group which has Microsoft.SystemCenter.ComputerGroup as a base class. Next we define the discoveries for the SSH_TestPack.Class and the SSH_TestPack.Group class.

<Discovery ID="SSH_TestPack.SSH_Testpack.Instance.Discovery" Target="Unix!Microsoft.Unix.Computer" Enabled="true" ConfirmDelivery="false" Remotable="true" Priority="Normal">
<DiscoveryClass TypeID="SSH_TestPack.Class">
<Property TypeID="SSH_TestPack.Class" PropertyID="RoleName" />
<DataSource ID="DS" TypeID="UnixAuth!Unix.Authoring.TimedShellCommand.Discovery.DataSource">
<ShellCommand>chkconfig --list | grep sshd | wc -l</ShellCommand>
<Value>SSH Instance</Value>
<Value>SSH Instance</Value>
<Discovery ID="SSH_TestPack.SSH_Testpack.Group.Discovery" Target="SSH_TestPack.Group" Enabled="true" ConfirmDelivery="false" Remotable="true" Priority="Normal">
<DiscoveryClass TypeID="SSH_TestPack.Class">
<Property TypeID="SSH_TestPack.Class" PropertyID="RoleName" />
<DiscoveryRelationship TypeID="SC!Microsoft.SystemCenter.ComputerGroupContainsComputer" />
<DataSource ID="DS" TypeID="SC!Microsoft.SystemCenter.GroupPopulator">


In the above script we define the discovery for the instances of the SSH_Testpack class based on the following shell command: chkconfig –list | grep sshd | wc –l. Based on the returned number an instance will be discovered. In the Group discovery all instances of the SSH_Testpack class will be added to the group. After these discoveries I defined one monitor which has a SSH_Testpack Class instance as a target. The following XML code define the monitor:

<UnitMonitor ID="SSH_TestPack.SSH_TestPack.Instance.ServiceMonitor" Accessibility="Internal" Enabled="true" Target="SSH_TestPack.Class" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="UnixAuth!Unix.Authoring.WSManEnumeration.ProcessCount.MonitorType" ConfirmDelivery="false">
<AlertSettings AlertMessage="SSH_TestPack.SSH_TestPack.Instance.ServiceMonitor.AlertMessage">
<OperationalState ID="ProcessCountOK" MonitorTypeStateID="ProcessCountOK" HealthState="Success" />
<OperationalState ID="ProcessCountError" MonitorTypeStateID="ProcessCountError" HealthState="Error" />


The above monitor will the availability of the sshd service(s). Based on the <MinProcessCount> and <MaxProcessCount> values the health state will be calculated.

My unsealed MP example can be downloaded here. Please note the disclaimer of my site before you import the MP!

If you have imported this MP you can select the SSH_TestPack class in the state view of the Unix/Linux Computer. When you have selected this the health states of the SSH service is showed in a State View


With defining a separate class for each service you can create a state view with the health states of your services. If you have any question regarding this topic please let me know

5 thoughts on “SCOM 2012: Adding Health States to a State View

Leave a Reply to Tymofii Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.