Page 1 of 1
NRPE / Linux connection refused
Posted: Mon May 12, 2014 5:20 pm
by Sbergonzi
I've gone through the install on Redhat (
http://assets.nagios.com/downloads/nagi ... _Agent.pdf) and then used the Linux wizard in XI to configure the host.
All services are noting: "OUTPUT: Connection refused by host"
Command "COMMAND: /usr/local/nagios/libexec/check_nrpe -H <host IP> -t 30 -c check_cpu_stats -a '-w 85 -c 95'"
I set the "allow connections from" at the last step of the install, entering the NagiosXI server.
Is there anything more to do? Where is that configuration stored (the Nagios server IP)?
thank you!!
Edit:
I added the Nagios server to the hosts.allow file as well. "nrpe: <host IP> <host DNS>"
Re: NRPE / Linux connection refused
Posted: Mon May 12, 2014 8:39 pm
by Box293
The first basic test is to see if an NRPE connection can be established from your Nagios host.
Logon to the CLI of your Nagios host and type the following command:
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H <host IP>
If it is working then it should respond with something like:
Code: Select all
I (0.3.7.494 2009-10-12) seem to be doing fine...
If that doesn't work, lets see if the Nagios host can talk to your Redhat server
Can you ping the Redhat server?
NRPE should be listening on port 5666 so lets test if the Nagios XI server can talk to the Redhat server on this port.
Logon to the CLI of your Nagios host and type the following command:
If it is working it should respond with something like:
Code: Select all
Starting Nmap 5.51 ( http://nmap.org ) at 2014-05-13 11:36 EST
Nmap scan report for <host IP>
Host is up (0.035s latency).
PORT STATE SERVICE
5666/tcp open nrpe
MAC Address: xxxxxxxxxxx
Nmap done: 1 IP address (1 host up) scanned in 0.25 seconds
Let us know if this has identified the area of the problem.
Re: NRPE / Linux connection refused
Posted: Tue May 13, 2014 8:25 am
by Sbergonzi
That seems to be the problem, NRPE is not running on that port. Do I have to do something to start it? I checked the config and it is listed.
Code: Select all
Starting Nmap 5.51 ( http://nmap.org ) at 2014-05-13 09:23 ED
Nmap scan report for <host IP>
Host is up (0.072s latency).
PORT STATE SERVICE
5666/tcp closed nrpe
Nmap done: 1 IP address (1 host up) scanned in 0.35 seconds
Edit:
i tried to start the service and it's getting an error, is this correct?
Code: Select all
$ ./service /usr/local/nagios/bin/nrpe start
/usr/local/nagios/bin/nrpe: unrecognized service
Deleted your second post and merged it here, please do not double post as it adds clutter and bumps you lower on our to-be-replied-to list.
Re: NRPE / Linux connection refused
Posted: Tue May 13, 2014 9:24 am
by slansing
Not sure where you got this command:
Code: Select all
./service /usr/local/nagios/bin/nrpe start
Are you running under xinetd or are you running the standalone nrpe agent...?
If you are running the standalone agent, then you can issue the following:
Code: Select all
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
Change the directories above if they differ on your end...If using xinetd, run:
That NMAP is showing you that the port is closed, that has nothing to do with NRPE specifically, you need to open 5666 TCP.
All of this is covered in numerous guides, such as but not limited to:
https://linuxmanage.com/nagios-check-ho ... lenny.html
http://nagios.sourceforge.net/docs/nrpe/NRPE.pdf
Re: NRPE / Linux connection refused
Posted: Tue May 13, 2014 10:10 am
by Sbergonzi
i assumed, perhaps incorrectly, that the NRPE install would make it part of xinetd. it doesn't appear that was the case. i tried then to start it standalone (thank you!) and it did start. i went into Nagios and tested the services, all worked ok.
how might i make it part of xinetd so it starts automatically?
Code: Select all
$ /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
$ netstat -at | grep nrpe
tcp 0 0 *:nrpe *:* LISTEN
$ netstat -nlp | grep 5666
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN 21654/nrpe
Re: NRPE / Linux connection refused
Posted: Tue May 13, 2014 10:33 am
by slansing
Well, do you have xinetd available? You will need to add it as a "attached service" to xinetd, that is done if you use the XI Linux Agent installer to install NRPE. If you compile from source it will not add it to xinetd.
This is more of a linux admin thing than a nagios thing but there is some information about this here:
http://www.comptechdoc.org/os/linux/use ... inetd.html
You could also look at the install script for the "XI Linux Agent".
Re: NRPE / Linux connection refused
Posted: Tue May 13, 2014 11:10 am
by Sbergonzi
ok thanks! good to close out -