Page 1 of 2
Port 5666 : connection refused
Posted: Wed May 20, 2020 4:45 am
by smeyichou
Hi,
Since a few months, Nagios Core, on its interface, can't connect to one of my servers, saying :
(No output on stdout) stderr: connection to adress xx.xxx.xxx.209 port 5666 : Connection refused
The host is on a CentOs server, as well as the client.
When i type, from the host server
, it tells me :
Port 5666/tcp closed nrpe
I read several other topics on it, but nothing works.
Also, when i type service
xinetd status, it tells me xitnetd is running, on both servers (the host and the client).
Do you have any ideas what i can do? What should i check or type?
Thanks !
Re: Port 5666 : connection refused
Posted: Wed May 20, 2020 2:59 pm
by gormank
I'd see if the local firewall (firewalld on later Centor/RH) on the server is blocking the port or, if nrpe (or ncpa?) is actually not running.
ps -ef | egrep -i -e 'nrpe|ncpa'
This just tells if the port is open locally...
netstat -an | grep 5666
Re: Port 5666 : connection refused
Posted: Thu May 21, 2020 3:00 am
by smeyichou
Ok, for the first command (
ps -ef | egrep -i -e 'nrpe|ncpa') on the main server :
Code: Select all
root 36412 36196 0 09:54 pts/0 00:00:00 egrep -i -e nrcpe|ncpa
For the second command (netstat - an | grep 5666), it gives me nothing
On the remote server (the one i can't connect to) it tells me :
Code: Select all
root 17044 17012 0 09:56 pts/0 00:00:00 egrep -i -e nrcpe|ncpa
Same for the second command, no info.
Re: Port 5666 : connection refused
Posted: Thu May 21, 2020 1:28 pm
by gormank
Sorry, I meant the client/remote side, and I seem to be mistaken about nrpe/ncps showing in the process list. Here's another ps with xinetd.
# ps -ef | egrep -i -e 'nrpe|ncpa|xinetd' | egrep -v 'grep|check_nrpe'
root 1097 1 0 May19 ? 00:00:00 /usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid
# netstat -an | grep 5666
tcp 0 0 172.30.130.22:57454 172.30.135.64:5666 ESTABLISHED
tcp 0 0 172.30.130.22:35496 172.30.130.75:5666 ESTABLISHED
tcp 0 0 172.30.130.22:54782 172.30.130.90:5666 ESTABLISHED
tcp 0 0 172.30.130.22:47868 172.29.130.75:5666 ESTABLISHED
I'd check /etc/xinetd.d/n??? files to see what agent is used, and if its set up.
There are TS guides on the KB pages once you decide what agent is used.
https://support.nagios.com/kb/
Re: Port 5666 : connection refused
Posted: Fri May 22, 2020 1:47 am
by smeyichou
Ok, here what it gives me on the remote side (the server that can't be accessed) :
# ps -ef | egrep -i -e 'nrpe|ncpa|xinetd' | egrep -v 'grep|check_nrpe'
Code: Select all
root 4054 1 0 May20 ? 00:00:00 xinetd -stayalive -pidfile /var/run/xinetd.pid
# netstat -an | grep 5666
I then went to /etc/xinetd.d/ on the remote server, and here are the files in this directory :
apgd chargen-dgram chargen-stream daytime-dgram daytime-stream discard-dgram discard-stream echo-dgram echo-stream rsync tcpmux-server time-dgram time-stream
I'm a bit confused since i'm a beginner concerning Nagios, sorry. There is definitely no nrpe file in this directory.
Re: Port 5666 : connection refused
Posted: Fri May 22, 2020 9:46 am
by gormank
Could you have a look at a similar server /etc/xinetd.d/nrpe file, create it on the problem host and restart xinetd?
Re: Port 5666 : connection refused
Posted: Fri May 22, 2020 4:45 pm
by ssax
Did you install NRPE on the system?
What does this output?
find / -name nrpe.cfg
service nrpe status
Re: Port 5666 : connection refused
Posted: Sat May 23, 2020 4:51 am
by smeyichou
gormank wrote:Could you have a look at a similar server /etc/xinetd.d/nrpe file, create it on the problem host and restart xinetd?
I don't have this file on any server, not the main one, and not the remote one.
ssax wrote:Did you install NRPE on the system?
What does this output?
find / -name nrpe.cfg
service nrpe status
On the main server, it tells me it is located in
/usr/local/nagios/etc/nrpe.cfg
On the remote server, it doesn't find me anything
For
service nrpe status, on BOTH servers, it tells me :
Thanks for your help guys by the way, it's for my job so i'll tale a look at your future answers on Monday
Re: Port 5666 : connection refused
Posted: Mon May 25, 2020 3:51 am
by smeyichou
Do you guys need more info
Re: Port 5666 : connection refused
Posted: Thu May 28, 2020 3:24 am
by smeyichou
Please save me