Page 1 of 1

NRPE:connection refused by host

Posted: Fri Aug 30, 2013 11:21 pm
by barry1946
I receive connection refused by host for NRPE
i have installed nrpe on vmware
I have allowed the nrpe virtual server and the vmware host both added in nrpe.cfg(127.0.0.1,192.168.242.128(this is the virtual machine which nagios is running on it),192.168.25.45(it is the vmware host ip which is the virtual machine is running on it)
the netstat -an | grep 5666 result is listen
I start nrpe with /etc/init.d nrpe start
the firewall is stopped and SElinux is disabled either
I have tried all the instructions on the internet with no result!

any idea i would appreciate .

Re: NRPE:connection refused by host

Posted: Mon Sep 02, 2013 4:47 am
by gshergill
Hi barry1946,

I'm not sure how you installed the NRPE, or which OS, but below are some instructions which hopefully help..

In this example, I installed from source on Ubunutu and using xinetd (I can provide a complete set of instructions from scratch if eventually required).

Edit the file /etc/xinetd.d/nrpe and add the Nagios server's IP;

Code: Select all

vi /etc/xinetd.d/nrpe
Change;

Code: Select all

only_from       = 127.0.0.1
To;

Code: Select all

only_from       = 127.0.0.1 <ip of nagios machine>
e.g.

Code: Select all

only_from       = 127.0.0.1 192.168.3.114
Edit the file /etc/services to listen on port 5666 for Nagios;

Code: Select all

vi /etc/services
Add the following to the end of the file;

Code: Select all

nrpe 5666/tcp # NRPE
Now you restart the xinetd service;

Code: Select all

service xinetd restart
You can now check if NRPE is listening with the following command;

Code: Select all

netstat -at | grep nrpe
This should produce the following output;

Code: Select all

tcp 0      0 *:nrpe *:*                         LISTEN
Now finally test that it is working with the following command from the Nagios Server;

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H <remote host IP>
This should have output (based on version);

Code: Select all

NRPE v2.13
Hopefully the tests can help as well to pinpoint the issue.

Good luck!

Kind Regards,

Gary Shergill

Re: NRPE:connection refused by host

Posted: Tue Sep 03, 2013 10:28 am
by abrist
gshergill is right on all counts. I would like to also refer you to the following document:
http://assets.nagios.com/downloads/nagi ... utions.pdf