CHECK_NRPE Could not connect to....: Connect reset by peer in Nagios NRPE

riasc picture riasc · Aug 26, 2016 · Viewed 27k times · Source

Im working on opensuse Leap 42.1. I have installed NRPE on the remote host. I following precisely the installation guide. However, the deaemon runs:

netstat -at | egrep "nrpe|5666"
tcp        0      0 *:nrpe                  *:*                     LISTEN      
tcp        0      0 *:nrpe                  *:*                     LISTEN 

But executing CHECK_NRPE gives me the following error:

/usr/local/nagios/lib/check_nrpe -H localhost
CHECK_NRPE: Error - Could not connect to ::e298:8aF0:2cdf:0: Connection reset by peer

I dont see what is the problem here. I tried the installation several times. Firewall is off, but that shouldn't be the problem. Haven't found the error anywhere else. What am I missing? Thanks

Answer

Ziprasidone picture Ziprasidone · Mar 21, 2017

I had the same problem.

Just, look the file: /etc/xinetd.d/nrpe

Now, find (almost at beggining) the line that says

"disable = yes"

and simply change it to "no", then:

# systemctl restart xinetd.service

# systemctl restart nrpe or # service nrpe restart (if not systemd)

Testing on debian 8 with last nrpe installation guide.

Hope it helps!

PS: Don't forget the directive.

"only_from = (...)"

EDIT:

In the last NRPE installation on debian 8 you have to:

Edit: /usr/local/nagios/etc/nrpe.cfg

line 98: allowed_hosts=x.x.x.x

And in the /etc/xinetd.d/nrpe let the directive "disable" in "yes". (default)

It seems like nrpe service look at allowed hosts in /usr/local/nagios/etc/nrpe.cfg instead of /etc/xinetd.d/nrpe.

Because in the /etc/xinetd.d/nrpe there is this line:

 server_args     = -c /usr/local/nagios/etc/nrpe.cfg --inetd

Now, yes:

# systemctl restart nrpe.service && systemctl restart xinetd.service