socket timeout after 30 seconds

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
iroy
Posts: 53
Joined: Tue Jul 26, 2016 4:46 pm

socket timeout after 30 seconds

Post 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.
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: socket timeout after 30 seconds

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
iroy
Posts: 53
Joined: Tue Jul 26, 2016 4:46 pm

Re: socket timeout after 30 seconds

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

Re: socket timeout after 30 seconds

Post 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!
Be sure to check out our Knowledgebase for helpful articles and solutions!
iroy
Posts: 53
Joined: Tue Jul 26, 2016 4:46 pm

Re: socket timeout after 30 seconds

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

Re: socket timeout after 30 seconds

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
iroy
Posts: 53
Joined: Tue Jul 26, 2016 4:46 pm

Re: socket timeout after 30 seconds

Post 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.
iroy
Posts: 53
Joined: Tue Jul 26, 2016 4:46 pm

Re: socket timeout after 30 seconds

Post 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
}
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: socket timeout after 30 seconds

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
iroy
Posts: 53
Joined: Tue Jul 26, 2016 4:46 pm

Re: socket timeout after 30 seconds

Post 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
You do not have the required permissions to view the files attached to this post.
Locked