check_nrpe socket timeout after n seconds

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
manish2tiwari
Posts: 31
Joined: Thu Sep 13, 2012 12:48 pm

check_nrpe socket timeout after n seconds

Post by manish2tiwari »

Hi All,

We are facing check_nrpe socket timeout after 10 seconds error whenever we are trying to use check_nrpe command for one of our Unix server.
We are using Red Hat Enterprise Linux Server release 5.6 (Tikanga) as the target server and virtual machine as the Source Nagios server.

We are able to use the same command for our windows server.

We have done the configuration settings as required in all the configuration file but not able to run the command on target server. local host in unix server is working fine and giving below output

Command: /usr/local/nagios/libexec/check_nrpe -H localhost
Output: NRPE v2.12

Please let us know if we are missing anything here.

Thanks in advance,
Manish
+004917687766033
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: check_nrpe socket timeout after n seconds

Post by slansing »

Are you using this check to see if they can communicate?:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H host.ip.address.here
Or a custom check? Just making sure you are trying the same thing. Do you have the NRPE standard port 5666 opened on the RHEL server?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_nrpe socket timeout after n seconds

Post by scottwilkerson »

Also, for some background also, did you use the our Linux agent installer?

And, on the machine with the agent installed can you see it listening on port 5666

Code: Select all

 netstat -lnp |grep 5666
Finally you may need to verify you don't have a firewall blocking port 5666
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
manish2tiwari
Posts: 31
Joined: Thu Sep 13, 2012 12:48 pm

Re: check_nrpe socket timeout after n seconds

Post by manish2tiwari »

Hi Scott,

The command (netstat -lnp |grep 5666) is giving below reply:

tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN 19004/nrpe

Hi Slansing,

Yes i am using that check on the Nagios hosting server and getting socket timeout error there.

Thanks,
Manish
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: check_nrpe socket timeout after n seconds

Post by slansing »

Can you check your nrpe.cfg file and make sure that you have your XI server listed as an allowed host?:

Code: Select all

vi /usr/local/nagios/etc/nrpe.cfg
manish2tiwari
Posts: 31
Joined: Thu Sep 13, 2012 12:48 pm

Re: check_nrpe socket timeout after n seconds

Post by manish2tiwari »

yes /usr/local/nagios/etc/nrpe.cfg contains below line:

allowed_hosts=10.123.4.21

10.123.4.21 is our Nagios XI server.

Thanks,
Manish
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: check_nrpe socket timeout after n seconds

Post by slansing »

Did you restart the NRPE service after editing the nrpe.cfg?

Code: Select all

service nrpe restart
Are you running any custom firewalls?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_nrpe socket timeout after n seconds

Post by lmiltchev »

Can you also run the following command and the output of it?

Code: Select all

iptables -L -n | grep 5666
Be sure to check out our Knowledgebase for helpful articles and solutions!
manish2tiwari
Posts: 31
Joined: Thu Sep 13, 2012 12:48 pm

Re: check_nrpe socket timeout after n seconds

Post by manish2tiwari »

@Slansing: service restart nrpe is giving command cannot found error, is there any specific path where i have to run it.

@limiltchev: iptables -L -n | grep 5666 command in my Nagios XI server giving below output:

tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5666
ACCEPT - tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5666
ACCEPT - tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5666
ACCEPT - tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5666
tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5666
ACCEPT - tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5666
ACCEPT - tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5666
ACCEPT - tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5666

Thanks,
Manish
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_nrpe socket timeout after n seconds

Post by scottwilkerson »

Not sure why you have so many extra lines in there, also you have a single line without ACCEPT in front of it

Code: Select all

tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:5666
Here is what I would recommend, edit /etc/sysconfig/iptables-config and change the following to yes
IPTABLES_SAVE_ON_STOP
IPTABLES_SAVE_ON_RESTART

Then stop iptables, and edit /etc/sysconfig/iptables to have a line like

Code: Select all

-A INPUT -m state --state NEW -m tcp -p tcp --dport 5666 -j ACCEPT
Then start iptables

also to restart nrpe you may need to run

Code: Select all

/etc/init.d/nrpe restart
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked