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
How to increase NRPE socket timeout??
Re: How to increase NRPE socket timeout??
What version of check_nrpe are you using?
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
./check_nrpe
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??
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??
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??
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
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??
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.
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??
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
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??
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.
Try putting the -t 30 before the -c and see if that makes any difference.
Re: How to increase NRPE socket timeout??
Thanks, tried that but no luck.
-
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: How to increase NRPE socket timeout??
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
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