SNMP based monitors and numeric expressions workaround
Posted by rburri on June, 10 2008
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:
- Reimport your management pack
The following expression will work correctly with SNMP probe and trap driven monitors: