Page 1 of 2

Connection Refused/Connection Refused by Host

Posted: Fri Dec 20, 2013 9:56 am
by micropact
Hi everyone,

I'm working through these agent issues one by one and I've hit a snag.

We have a group of servers that run on Debian. They are old and as such I had to install Nagios from source. I have it installed and the agent runs but I get "Connection Refused" and "Connection Refused by host" errors in the Service Detail. Nagios can ping the servers so it's not a network issue and there are no firewalls, software or hardware, between the host and the Nagios server that would block the traffic.

I've updated allowed_hosts in /etc/nagios/nrpe.cfg to contain the IP Address of the Nagios server and then restarted the daemon with the command:
/etc/init.d/nagios3 restart

If I run check_nrpe I get an error that the connection was refused.

Obviously, I'm not adding the allowed_hosts in the correct place. I'm not using xinetd.

Thanks!

Re: Connection Refused/Connection Refused by Host

Posted: Fri Dec 20, 2013 10:43 am
by micropact
Also, it's clear to me that I'm updating allowed_hosts in the wrong place because of this line in the nrpe.cfg:
# NOTE: This option is ignored if NRPE is running under either inetd or xinetd

I'm running it on inetd but just can't figure out where to edit the allowed_hosts.

Re: Connection Refused/Connection Refused by Host

Posted: Fri Dec 20, 2013 10:48 am
by tmcdonald
Should just be /etc/inetd.conf

Check out http://debian-handbook.info/browse/sque ... inetd.html

Re: Connection Refused/Connection Refused by Host

Posted: Fri Dec 20, 2013 10:57 am
by micropact
I don't have an inetd.conf file.

Re: Connection Refused/Connection Refused by Host

Posted: Fri Dec 20, 2013 11:05 am
by tmcdonald

Code: Select all

find / -name inetd.conf

Re: Connection Refused/Connection Refused by Host

Posted: Fri Dec 20, 2013 11:05 am
by abrist
Connection refused can be caused by a number of things. Start by scanning the remote port 5666 from the nagios server:

Code: Select all

nmap <remote host ip> -p 5666
If it is open, try to just get the version information:

Code: Select all

./check_nrpe -H <remote host ip> 

Re: Connection Refused/Connection Refused by Host

Posted: Fri Dec 20, 2013 11:08 am
by micropact
There is no inetd.conf file in my Debian install. That file is not used on a lot of recent versions of linux.

Re: Connection Refused/Connection Refused by Host

Posted: Fri Dec 20, 2013 11:11 am
by micropact
Also, the server is working fine for other hosts so the ports are open and working correctly. It's just not working properly on our Debian installs where I had to install it from source.

Re: Connection Refused/Connection Refused by Host

Posted: Fri Dec 20, 2013 11:22 am
by micropact
Actually, reading everything. I think I'm misunderstanding inetd/init.d. I'm not running NRPE under inetd on this server.

Re: Connection Refused/Connection Refused by Host

Posted: Fri Dec 20, 2013 11:45 am
by abrist
micropact wrote:Also, the server is working fine for other hosts so the ports are open and working correctly. It's just not working properly on our Debian installs where I had to install it from source.
But are the ports open and working on the debian installs? Could you post the output of the commands from my previous email (run them on the XI server)