Page 1 of 2

How to increase NRPE socket timeout??

Posted: Tue May 05, 2015 1:01 pm
by xpac
So I have a remote check that needs to be run, and it takes longer than 10 seconds to run, and as such I keep getting "Socket timeout after 10 seconds".

That's fine, so I went and added "-t 30" to the commands.cfg file (for the NRPE command), and verified in the nrpe.cfg file on the remote client that it was still set to default which is 60 seconds I believe.

Restarted nagios service and.....it still tells me it timeouts after 10 seconds.

Is there somewhere else I should be setting the socket timeout? I want it to be a minimum of 30 seconds, it just isn't cooperating :lol:

Re: How to increase NRPE socket timeout??

Posted: Tue May 05, 2015 1:18 pm
by ssax
What version of check_nrpe are you using?

Code: Select all

./check_nrpe
It will say at the top.

I tested with version 2.15 and it works as expected.

What happens if you run it from the command line manually?

Code: Select all

su nagios
cd /usr/local/nagios/libexec
./check_nrpe -H 192.168.5.232 -c YOURCOMMAND -t 20

Re: How to increase NRPE socket timeout??

Posted: Tue May 05, 2015 1:54 pm
by xpac
I'm running 2.15, and when I run the command and add -t 20 at the end it does in fact run correctly without timing out. Just doesn't seem to want to do it when I add the -t value to the check_nrpe command definition in the commands.cfg

Re: How to increase NRPE socket timeout??

Posted: Tue May 05, 2015 1:58 pm
by ssax
Please post you service definition and your command definition so that we can take a look at them.

Re: How to increase NRPE socket timeout??

Posted: Tue May 05, 2015 2:04 pm
by xpac
Here's the check_nrpe definition:

define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -t 30
}


service definition:

command[check_cassandra]=HOME=~nagios /usr/local/nagios/libexec/check_cassandra_cluster.sh

Re: How to increase NRPE socket timeout??

Posted: Tue May 05, 2015 2:06 pm
by ssax
Sorry, I meant the service definition that is calling the check_nrpe command.

You might want to check service_check_timeout in /usr/local/nagios/etc/nagios.cfg file, the default should be 60.

Re: How to increase NRPE socket timeout??

Posted: Tue May 05, 2015 2:13 pm
by xpac
Ok, so the service definition it is:

define service{
use generic-service
host_name cassandratest,cassandratest2
service_description Cassandra Monitoring
check_command check_nrpe!check_cassandra
}

Perhaps I need to add the -t here?

Also, the nrpe.cfg file on the remote client has the following settings:

command_timeout=60

connection_timeout=300

Re: How to increase NRPE socket timeout??

Posted: Tue May 05, 2015 2:20 pm
by ssax
No, you put it in the right section, I just wanted to make sure your service was calling the one you modified.

Try putting the -t 30 before the -c and see if that makes any difference.

Re: How to increase NRPE socket timeout??

Posted: Tue May 05, 2015 3:41 pm
by xpac
Thanks, tried that but no luck.

Re: How to increase NRPE socket timeout??

Posted: Tue May 05, 2015 4:00 pm
by jdalrymple
That is bizarre, it really should be behaving based upon what you've said. Let's double check how Nagios Core is interpreting the command.

Left hand pane under System click Configuration
Choose Services from the dropdown and hit Continue
Find your service in the list - click the hyperlink that's in the Check Command column

screenshot... I'll show you what one of mine looks like