Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

nagios

nrpe

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

like image 886
riasc Avatar asked Aug 26 '16 11:08

riasc


People also ask

What port does Nrpe use?

If the server has a firewall running, you need to allow access to the NRPE port (5666) from the Nagios server. On other systems and other firewalls, check the documentation or have an administrator open the port.

What is Nrpe command?

To anyone who is accidentally stumbled upon this article and still wondering what is NRPE stands for — It stands for Nagios Remote Plugin Executor :) © realnets.com. NRPE is used to execute Nagios plugins on remote clients. It is very useful if you want to monitor remote clients or get metrics of remote clients.

What is the significance of Nrpe Nagios Remote Plugin Executor in Nagios?

NRPE allows you to remotely execute Nagios plugins on other Linux/Unix machines. This allows you to monitor remote machine metrics (disk usage, CPU load, etc.). NRPE can also communicate with some of the Windows agent addons, so you can execute scripts and check metrics on remote Windows machines as well.

What is Nagios Nrpe?

Nagios Remote Plugin Executor (NRPE) is a Nagios agent that allows remote system monitoring using scripts that are hosted on the remote systems. It allows for monitoring of resources such as disk usage, system load or the number of users currently logged in.


2 Answers

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
like image 162
Ziprasidone Avatar answered Sep 17 '22 22:09

Ziprasidone


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
like image 28
AbdiFatah Ahmed Ali Avatar answered Sep 20 '22 22:09

AbdiFatah Ahmed Ali