Page 1 of 4

socket timeout after 30 seconds

Posted: Fri Sep 09, 2016 5:11 pm
by iroy
CHECK_NRPE: Socket timeout after 30 seconds

When I am applying config changes, I am getting above message for the remote server.

I have 2 servers (A & B) and have nagiosxi on installed both.

I'm using the nagiosxi servers to monitor each other, meaning A monitors B and B monitors A.

Above error message is happening for B monitoring A for services like Total Processes; the only service that is responding correctly is Ping.

A monitoring B is not even kicking in.

Re: socket timeout after 30 seconds

Posted: Mon Sep 12, 2016 12:48 pm
by lmiltchev
Is xinetd running on both servers? Did you add the servers' IPs to the "/etc/xinetd.d/nrpe" file ("only_from" line)? Can you show us an example of a check, run from the command line, along with the output of it? Example:

Code: Select all

[root@localhost libexec]# /usr/local/nagios/libexec/check_nrpe -H <client ip> -c check_users -a '-w 2 -c 5'
USERS OK - 1 users currently logged in |users=1;2;5;0

Re: socket timeout after 30 seconds

Posted: Mon Sep 12, 2016 2:31 pm
by iroy
thanks lmiltchev.

root@vps-cl0:/etc/xinetd.d# /usr/local/nagios/libexec/check_nrpe -H 192.168.1.24 -t 30 -c check_users -a -w 5 -c 10
CHECK_NRPE: Socket timeout after 30 seconds.

Is this how i modify /etc/xinetd.d/nrpe:
only_from = 127.0.0.1, 192.168.1.24
# 192.168.1.24 is the remote server

And for the change to take effect do I have to reboot the server or just restart nagios.

Re: socket timeout after 30 seconds

Posted: Mon Sep 12, 2016 3:07 pm
by lmiltchev
Is this how i modify /etc/xinetd.d/nrpe:
only_from = 127.0.0.1, 192.168.1.24
# 192.168.1.24 is the remote server
Actually, no. The IPs must be space separated, not comma separated. You should have:

Code: Select all

only_from = 127.0.0.1 192.168.1.24
And for the change to take effect do I have to reboot the server or just restart nagios.
No, you need to restart xinetd.

Code: Select all

service xinetd restart
Let us know if this helped. Thanks!

Re: socket timeout after 30 seconds

Posted: Mon Sep 12, 2016 3:36 pm
by iroy
ok i restarted xinetd after entering the other ip in /etc/xinetd.d/nrpe and it ran to check on the other host.
However it is telling me that the host is down when the host is actually up.

Re: socket timeout after 30 seconds

Posted: Mon Sep 12, 2016 4:17 pm
by lmiltchev
Can you show us the actual check that is failing run from the command line along with the output of it?


It is possible that your firewall is blocking port 5666. What is the output of the following commands?

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H <client ip>
nmap <client ip> -p 5666

Re: socket timeout after 30 seconds

Posted: Mon Sep 12, 2016 6:00 pm
by iroy
root@vps-cl2:/etc/xinetd.d# /usr/local/nagios/libexec/check_nrpe -H 192.168.1.22 nmap 192.168.1.22 -p 5666 -t 30
CHECK_NRPE: Socket timeout after 30 seconds.

Re: socket timeout after 30 seconds

Posted: Mon Sep 12, 2016 6:38 pm
by iroy
Here is the config for monitoring the host. there is no firewall between the servers.

define host {
host_name 192.168.1.22
use xiwizard_website_host
address 192.168.1.22
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
contacts nagiosadmin
notification_interval 60
notification_period xi_timeperiod_24x7
notifications_enabled 1
icon_image www_server.png
statusmap_image www_server.png
_xiwizard websiteurl
register 1
}

Re: socket timeout after 30 seconds

Posted: Tue Sep 13, 2016 1:42 pm
by tgriep
The server at IP address 192.168.1.23, can you login as root, run the following commands and post the output?

Code: Select all

netstat -an
service iptables status
service firewalld status
ps -ef --cols=300
cat /etc/xinetd.d/nrpe
Then do the same on the other server and post that as well.

Thanks

Re: socket timeout after 30 seconds

Posted: Tue Sep 13, 2016 3:22 pm
by iroy
thanks tgriep; pls help.

Server 192.168.1.24 is alerting that server 192.168.1.22 is down.
Server 192.168.1.22 is also alerting that server 192.168.1.24 is down.

Nagiosxi is installed on both the servers.

Ran your commands on both 24 and 22 and the results are attached in pdf.

netstat -an
service iptables status
service firewalld status
cat /etc/xinetd.d/nrpe
ps -ef --cols=300