How to increase NRPE socket timeout??

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.
xpac
Posts: 54
Joined: Mon Aug 25, 2014 3:43 pm

How to increase NRPE socket timeout??

Post 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:
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: How to increase NRPE socket timeout??

Post 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
xpac
Posts: 54
Joined: Mon Aug 25, 2014 3:43 pm

Re: How to increase NRPE socket timeout??

Post 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
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: How to increase NRPE socket timeout??

Post by ssax »

Please post you service definition and your command definition so that we can take a look at them.
xpac
Posts: 54
Joined: Mon Aug 25, 2014 3:43 pm

Re: How to increase NRPE socket timeout??

Post 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
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: How to increase NRPE socket timeout??

Post 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.
xpac
Posts: 54
Joined: Mon Aug 25, 2014 3:43 pm

Re: How to increase NRPE socket timeout??

Post 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
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: How to increase NRPE socket timeout??

Post 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.
xpac
Posts: 54
Joined: Mon Aug 25, 2014 3:43 pm

Re: How to increase NRPE socket timeout??

Post by xpac »

Thanks, tried that but no luck.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: How to increase NRPE socket timeout??

Post 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
Attachments
Clipboard01.jpg
Locked