SNMP based monitors and numeric expressions workaround


Operations Manager allows creating monitors based on either SNMP traps received or the data returned from an OID probe poll. Monitors of that type may be created using the OpsMgr Operations Console. David published a step-by-step guide on how to create a simple SNMP probe based monitor. The procedure for SNMP traps is quite similar. Unfortunately the monitors created by the wizards will not work correctly with numeric expressions (Greater than / Less than etc.). The logic will treat any value received from an SNMP network device as string.

  • Create the monitors as usual, using the wizards from OpsMgr’s autoring pane.
  • Export the management pack and open it in your favourite XML editor
  • Look for both <FirstExpression> and <SecondExpression>of the SNMP monitors. They will have a datasource type of ‘System.SnmpProbe.2SingleEvent2StateMonitorType‘ or ‘System.SnmpTrapProvider.2SingleEvent2StateMonitorType’.
  • Change <XPathQuery Type=”String> and <Value Type=”String> (four times in total). Replace “String” with one of the following values. Make sure you choose a datatype which will work with your data:
    • Boolean
    • Integer
    • UnsignedInteger
    • Double
    • Duration
    • DateTime
  • Reimport your management pack

The following expression will work correctly with SNMP probe and trap driven monitors:

 <XPathQuery Type=”Integer>/DataItem/SnmpVarBinds/SnmpVarBind[1]/Value</XPathQuery>
 <Value Type=”Integer>45</Value>

One thought on “SNMP based monitors and numeric expressions workaround

  1. Pingback: Configuring SNMP monitoring with OpsMgr 2007 « System Center Operations Manager 2007 R2

Leave a Reply

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

You are commenting using your 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