6

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

riasc
  • 281
  • 2
  • 3
  • 15
  • Does it work with the IP address of the localhost (127.0.0.1)? Do you have an entry in your /etc/hosts file for 'localhost'? – Jim Black Aug 26 '16 at 15:18
  • Hi. Thanks. It works with 127.0.0.1 and I also have an entry for localhost `127.0.0.1 localhost` – riasc Aug 26 '16 at 21:46
  • You might want to disable IPv6 support, unless your entire network really supports it. – Jim Black Sep 19 '16 at 04:30

2 Answers2

10

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
Ziprasidone
  • 116
  • 2
  • 5
2

in my case the issue was only i need to stop nrpe process and start again

ps aux | grep nrpe

kill xxxx


run nrpe service

/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
Vickel
  • 7,879
  • 6
  • 35
  • 56