Page 1 of 2
CHECK_NRPE: Socket timeout after 10 seconds
Posted: Wed Feb 26, 2014 10:37 am
by dbarnsdal
Hi guys,
This is my first install of nagios for testing. I have just done a base install of nagios core and plugins on a new monitor server running red hat 5.4. The installation appeared to go fine without any errors. However after installing the NRPE on the monitor and a client server, I am getting the above error. I am able to get each server to telnet locally to the 5666 port on each server, but nothing goes across between the two servers.
I have added the monitor server to the hosts.allow on the client.
Neither server is running a firewall and they are both on the same subnet.
Any help would be greatly appreciated.
Thanks,
Derrick
Re: CHECK_NRPE: Socket timeout after 10 seconds
Posted: Wed Feb 26, 2014 10:43 am
by slansing
Can you telnet port 5666 from the nagios server? This is the only way to validly test if you can remotely connect through that socket.
Re: CHECK_NRPE: Socket timeout after 10 seconds
Posted: Wed Feb 26, 2014 10:48 am
by dbarnsdal
No, the telnet from the nagios server to the client times out.
Re: CHECK_NRPE: Socket timeout after 10 seconds
Posted: Wed Feb 26, 2014 10:56 am
by tmcdonald
Are there any hardware firewalls running between the server and client?
Did you edit the xinetd config for NRPE on the client?
From the client, run the following and post the output:
Code: Select all
service nrpe status
service xinetd status
grep "only" /etc/xinet.d/nrpe
iptables -L
And from the server, run the following and post the output:
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H <client IP>
iptables -L
Re: CHECK_NRPE: Socket timeout after 10 seconds
Posted: Wed Feb 26, 2014 10:57 am
by slansing
Please run this from the Nagios server:
And share the output here.
Re: CHECK_NRPE: Socket timeout after 10 seconds
Posted: Wed Feb 26, 2014 11:18 am
by dbarnsdal
detvmrh2 is the client
[root@detvmrh2 ~]# service nrpe status
nrpe: unrecognized service
[root@detvmrh2 ~]# service xinetd status
xinetd (pid 1560) is running...
[root@detvmrh2 ~]# grep "only" /etc/xinetd.d/nrpe
only_from = 127.0.0.1 158.60.146.196
[root@detvmrh2 ~]# service iptables status
Firewall is stopped.
[root@detvmrh2 ~]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Re: CHECK_NRPE: Socket timeout after 10 seconds
Posted: Wed Feb 26, 2014 11:21 am
by dbarnsdal
dethprh2 is the monitoring server
[root@dethprh2 libexec]# /usr/local/nagios/libexec/check_nrpe -H 158.60.140.211
CHECK_NRPE: Socket timeout after 10 seconds.
[root@dethprh2 libexec]# service iptables status
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
Chain FORWARD (policy ACCEPT)
num target prot opt source destination
Chain OUTPUT (policy ACCEPT)
num target prot opt source destination
[root@dethprh2 libexec]# nmap 5666 158.60.146.211
Starting Nmap 4.11 (
http://www.insecure.org/nmap/ ) at 2014-02-26 11:08 EST
Invalid target host specification: 5666
QUITTING!
From the first set I sent, it appears I need to start the service, but I'm not sure where to start it from. Sorry...new to nagios, expected it to deposit something in /etc/init.d
Re: CHECK_NRPE: Socket timeout after 10 seconds
Posted: Wed Feb 26, 2014 11:39 am
by dbarnsdal
Sorry, was running the nmap command backward.
[root@dethprh2 libexec]# nmap 158.60.140.211 5666
Starting Nmap 4.11 (
http://www.insecure.org/nmap/ ) at 2014-02-26 11:30 EST
Failed to find device eth0 which was referenced in /proc/net/route
Failed to find device eth0 which was referenced in /proc/net/route
nexthost: failed to determine route to 158.60.140.211
QUITTING!
[root@dethprh2 libexec]# ping 158.60.140.211
PING 158.60.140.211 (158.60.140.211) 56(84) bytes of data.
64 bytes from 158.60.140.211: icmp_seq=1 ttl=64 time=0.759 ms
64 bytes from 158.60.140.211: icmp_seq=2 ttl=64 time=1.55 ms
64 bytes from 158.60.140.211: icmp_seq=3 ttl=64 time=0.494 ms
Also, I am trying to run the nrpe and it won't stay up.
Is this the correct context?
/usr/local/nagios/bin/nrpe -i -4 -n -c /usr/local/nagios/etc/nrpe.cfg
Re: CHECK_NRPE: Socket timeout after 10 seconds
Posted: Wed Feb 26, 2014 3:55 pm
by lmiltchev
Can you run the following commands and show us the output?
On the client (remote box):
Code: Select all
ps axuw | grep nrpe
netstat -at | grep nrpe
On the nagios box:
Re: CHECK_NRPE: Socket timeout after 10 seconds
Posted: Wed Feb 26, 2014 4:05 pm
by dbarnsdal
Client
[root@detvmrh2 nrpe-2.15]# ps axuw | grep nrpe
root 9384 0.0 0.0 61228 772 pts/1 S+ 16:00 0:00 grep nrpe
[root@detvmrh2 nrpe-2.15]# netstat -at | grep nrpe
tcp 0 0 *:nrpe *:* LISTEN
Server
[root@dethprh2 init.d]# nmap 158.60.146.211 -p 5666
Starting Nmap 4.11 (
http://www.insecure.org/nmap/ ) at 2014-02-26 15:57 EST
Failed to lookup subnet/netmask for device (eth0): eth0: no IPv4 address assigned
QUITTING!
From what I read, if the nrpe is running inside of xinetd, it doesn't need to be run as a service? Is this correct?