Using check_snmp with a string - critical when matched


#1

I’ve got some old HP printers that don’t respond properly to check_toner. I’m trying to use check_snmp to get an alert when the toner is low. I have the string check confirmed as working, but I can’t see how to get it to alert when a match is made since it returns OK on a match. It think this would be a good use for negate, but that plugin doesn’t work in 1.4.15.

Here is the check I’m testing with:

check_snmp -C public -H 192.168.100.1 -o 1.3.6.1.2.1.43.16.5.1.2.1.1 -s '"TONER LOW"'

This returns OK when the status is TONER LOW. Any other status returns Critical, but I need it to work the other way.


#2

negate should do what you need.
Negate only changes the exit code so the output will still be OK. but you should see it as a critical in nagios.