Page 1 of 1

Check SNMP alerting on Status messages

Posted: Mon Jan 05, 2015 6:51 pm
by OptimusB
I am configuring SNMP service checks for NetApp aggregate status which returns either Online or Offline. How do I configure the service so that if it returns "Offline" it will set the state to critical?

Code: Select all

[root@ ~]# snmpwalk -v2c -c public <IP> 1.3.6.1.4.1.789.1.5.11.1.5 
NETAPP-MIB::aggrState.1026 = STRING: online

Re: Check SNMP alerting on Status messages

Posted: Mon Jan 05, 2015 7:23 pm
by Box293
check_snmp allows you to perform regular expression matching which can trigger critical states if there is no match.

from check_snmp --help
-R, --eregi=REGEX
Return OK state (for that OID) if case-insensitive extended REGEX matches
This will need some testing, but I think you're after this:

Code: Select all

check_snmp -H <IP> -C public -P 2c -o 1.3.6.1.4.1.789.1.5.11.1.5 -R /online$/

Re: Check SNMP alerting on Status messages

Posted: Tue Jan 06, 2015 12:31 pm
by OptimusB
Thank you. I ended up with the follow argument which worked as instructed.

Code: Select all

check_snmp -H <IP> -P 2c -c public -t 30 -o 1.3.6.1.4.1.789.1.5.11.1.5.1026 -r \online
Tested this with different regex to ensure that status not matching "online" will trigger a critical state. Thanks!