CHECK_NRPE: Socket timeout after 10 seconds

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.
dbarnsdal
Posts: 9
Joined: Wed Feb 26, 2014 10:16 am

CHECK_NRPE: Socket timeout after 10 seconds

Post 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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: CHECK_NRPE: Socket timeout after 10 seconds

Post 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.
dbarnsdal
Posts: 9
Joined: Wed Feb 26, 2014 10:16 am

Re: CHECK_NRPE: Socket timeout after 10 seconds

Post by dbarnsdal »

No, the telnet from the nagios server to the client times out.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: CHECK_NRPE: Socket timeout after 10 seconds

Post 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
Former Nagios employee
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: CHECK_NRPE: Socket timeout after 10 seconds

Post by slansing »

Please run this from the Nagios server:

Code: Select all

yum install nmap

Code: Select all

nmap 5666 <addr.of.remote.host>
And share the output here.
dbarnsdal
Posts: 9
Joined: Wed Feb 26, 2014 10:16 am

Re: CHECK_NRPE: Socket timeout after 10 seconds

Post 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
dbarnsdal
Posts: 9
Joined: Wed Feb 26, 2014 10:16 am

Re: CHECK_NRPE: Socket timeout after 10 seconds

Post 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
dbarnsdal
Posts: 9
Joined: Wed Feb 26, 2014 10:16 am

Re: CHECK_NRPE: Socket timeout after 10 seconds

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

Re: CHECK_NRPE: Socket timeout after 10 seconds

Post 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:

Code: Select all

nmap 158.60.140.211 -p 5666
Be sure to check out our Knowledgebase for helpful articles and solutions!
dbarnsdal
Posts: 9
Joined: Wed Feb 26, 2014 10:16 am

Re: CHECK_NRPE: Socket timeout after 10 seconds

Post 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?
Locked