Make NRPE timeouts report an 'Unknown' state

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
chstewart
Posts: 2
Joined: Thu May 10, 2018 9:54 am

Make NRPE timeouts report an 'Unknown' state

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Make NRPE timeouts report an 'Unknown' state

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
chstewart
Posts: 2
Joined: Thu May 10, 2018 9:54 am

Re: Make NRPE timeouts report an 'Unknown' state

Post by chstewart »

Perfect! Thank you!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Make NRPE timeouts report an 'Unknown' state

Post by scottwilkerson »

chstewart wrote:Perfect! Thank you!
Locking
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked