Connection Refused/Connection Refused by Host

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
micropact
Posts: 24
Joined: Thu Dec 19, 2013 3:56 pm

Connection Refused/Connection Refused by Host

Post 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!
micropact
Posts: 24
Joined: Thu Dec 19, 2013 3:56 pm

Re: Connection Refused/Connection Refused by Host

Post 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.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Connection Refused/Connection Refused by Host

Post by tmcdonald »

Should just be /etc/inetd.conf

Check out http://debian-handbook.info/browse/sque ... inetd.html
Former Nagios employee
micropact
Posts: 24
Joined: Thu Dec 19, 2013 3:56 pm

Re: Connection Refused/Connection Refused by Host

Post by micropact »

I don't have an inetd.conf file.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Connection Refused/Connection Refused by Host

Post by tmcdonald »

Code: Select all

find / -name inetd.conf
Former Nagios employee
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Connection Refused/Connection Refused by Host

Post 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> 
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
micropact
Posts: 24
Joined: Thu Dec 19, 2013 3:56 pm

Re: Connection Refused/Connection Refused by Host

Post 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.
micropact
Posts: 24
Joined: Thu Dec 19, 2013 3:56 pm

Re: Connection Refused/Connection Refused by Host

Post 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.
micropact
Posts: 24
Joined: Thu Dec 19, 2013 3:56 pm

Re: Connection Refused/Connection Refused by Host

Post by micropact »

Actually, reading everything. I think I'm misunderstanding inetd/init.d. I'm not running NRPE under inetd on this server.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Connection Refused/Connection Refused by Host

Post 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)
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked