Page 1 of 1

Make NRPE timeouts report an 'Unknown' state

Posted: Thu Jul 19, 2018 1:08 pm
by chstewart
We have services setup for disk and memory monitoring for Windows servers, but some hosts don't have NSClient configured correctly. So when Nagios checks them, XI reports a Critical state for those services. Ideally, I would want them to report an Unknown state so it would not send notifications when NRPE doesn't respond on a host. Is there a way I can make that happen?

Command:
/usr/local/nagios/libexec/check_nrpe -H 10.65.99.24 -t 30 -c check_memory -a "warn=free < 3%" "crit=free < 1%"

Output:
CHECK_NRPE STATE CRITICAL: Socket timeout after 30 seconds.

Re: Make NRPE timeouts report an 'Unknown' state

Posted: Thu Jul 19, 2018 1:25 pm
by lmiltchev
You should be able to use the "-u" flag, added to your command in order to do that.
-u, --unknown-timeout Make connection problems return UNKNOWN instead of CRITICAL
Example:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 10.65.99.24 -t 30 -c check_memory -a "warn=free < 3%" "crit=free < 1%"                                
CHECK_NRPE STATE CRITICAL: Socket timeout after 30 seconds.
 echo $?
2

/usr/local/nagios/libexec/check_nrpe -H 10.65.99.24 -t 30 -u -c check_memory -a "warn=free < 3%" "crit=free < 1%"
CHECK_NRPE STATE UNKNOWN: Socket timeout after 30 seconds.
echo $?
3

Re: Make NRPE timeouts report an 'Unknown' state

Posted: Thu Jul 19, 2018 2:28 pm
by chstewart
Perfect! Thank you!

Re: Make NRPE timeouts report an 'Unknown' state

Posted: Thu Jul 19, 2018 2:31 pm
by scottwilkerson
chstewart wrote:Perfect! Thank you!
Locking