Using snmp to check mailq on remote host
Using snmp to check mailq on remote host
I have been able to check remote hosts using the snmp command to run the check_mailq command remotely. Unfortunately I can't get nagios to alarm based on the results. The check_mailq returns the proper alarm whether it be warn or critical but when the snmp returns this result you end up with SNMP - OK :Critical: mailq is 3 ..." and the service will always be green. I have been unable to find out how to get around this. It seems the snmp check always puts that OK at the beginning which causes nagios to think everything is good. I am using nagios 3.4.1
Re: Using snmp to check mailq on remote host
Ahhh a classic trap, you're making the assumption that the words "OK" or "Critical" in the description mean anything to the Nagios engine. They do not. Nagios is all about the exit codes.
check_snmp hasn't been told how to tell the difference between OK and Critical, so it is just assuming that everything is always good. The easiest way to fix your problem would be to change your check_snmp to use the -r directive to tell it how to detect something going bad:
check_snmp hasn't been told how to tell the difference between OK and Critical, so it is just assuming that everything is always good. The easiest way to fix your problem would be to change your check_snmp to use the -r directive to tell it how to detect something going bad:
Code: Select all
./check_snmp [i]normal stuff here[/i] -r "OK"