Page 1 of 1

Service Check Timeout - Exit Warning Instead of Critical

Posted: Fri Aug 30, 2013 7:10 pm
by dlafuente
Hello all,

We have an issue on our servers sometimes where nagios runs a command, but it will exit critical with this message:

Message=CRITICAL - Socket timeout after 10 seconds


I don't mind that it exits with the socket timeout. In fact I want it to do that so it doesn't get stuck forever. BUT i don't want it to exit critical. I need it to exit warning or error or something other than critical.

How can i fix this? for example, if i am executing a command using check_by_ssh, it there some option or config parameter i can change so that if it times out it will only exit with a warning rather than a critical?

I can't have it exit critical because we have another application that is scanning Nagios searching for critical errors, but this is not something we want the application to pickup (hence why i want to switch it to warning)

Thanks in advance!

Re: Service Check Timeout - Exit Warning Instead of Critical

Posted: Tue Sep 03, 2013 10:35 am
by abrist
First of all, you may be able to increase the timeout of the check:
-t, --timeout=INTEGER
Seconds before connection times out (default: 10)
http://nagiosplugins.org/man/check_by_ssh

Second, take a look at the negate plugin, for altering return codes:
http://nagiosplugins.org/man/negate