Service Check Timeout - Exit Warning Instead of Critical

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
dlafuente
Posts: 1
Joined: Fri Aug 30, 2013 7:04 pm

Service Check Timeout - Exit Warning Instead of Critical

Post 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!
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Service Check Timeout - Exit Warning Instead of Critical

Post 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
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked