NagiosEnterprises / nrpe

NRPE Agent
GNU General Public License v2.0
263 stars 134 forks source link

CHECK_NRPE: Error - Could not connect to 192.168.1.28: Connection reset by peer #178

Closed indraraj26 closed 5 years ago

indraraj26 commented 6 years ago

OS detail : cat /etc/redhat-release CentOS release 6.9 (Final)

Linux clientlinux 2.6.32-696.el6.x86_64 #1 SMP Tue Mar 21 19:29:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Nagios Server (192.168.1.27) : var/log

Mar 30 20:04:53 testing check_nrpe: Error: (nerrs = 0)(!log_opts) Could not complete SSL handshake with 192.168.1.28: rc=-1 SSL-error=5 Mar 30 20:09:25 testing check_nrpe: Error: (nerrs = 0)(!log_opts) Could not complete SSL handshake with 192.168.1.28: rc=-1 SSL-error=5 Mar 30 20:10:26 testing check_nrpe: Error: (nerrs = 0)(!log_opts) Could not complete SSL handshake with 192.168.1.28: rc=-1 SSL-error=5

service nagios status nagios (pid 3029) is running...

service iptables status iptables: Firewall is not running.

[root@testing libexec]# sestatus SELinux status: disabled

ping 192.168.1.28 to remote server PING 192.168.1.28 (192.168.1.28) 56(84) bytes of data. 64 bytes from 192.168.1.28: icmp_seq=1 ttl=64 time=0.245 ms 64 bytes from 192.168.1.28: icmp_seq=2 ttl=64 time=0.237 ms 64 bytes from 192.168.1.28: icmp_seq=3 ttl=64 time=0.240 ms 64 bytes from 192.168.1.28: icmp_seq=4 ttl=64 time=0.207 ms 64 bytes from 192.168.1.28: icmp_seq=5 ttl=64 time=0.228 ms

with ssl

/usr/local/nagios/libexec/check_nrpe -H 192.168.1.28 CHECK_NRPE: Error - Could not connect to 192.168.1.28: Connection reset by peer

without ssl

/usr/local/nagios/libexec/check_nrpe -H 192.168.1.28 -n CHECK_NRPE: Receive header underflow - only -1 bytes received (4 expected).

remote server (192.168.1.28) : var/log

Mar 30 20:10:45 clientlinux nrpe[12796]: Host 192.168.1.27 is not allowed to talk to us! Mar 30 20:11:52 clientlinux nrpe[12802]: Host 192.168.1.27 is not allowed to talk to us! Mar 30 20:11:58 clientlinux nrpe[12804]: Host 192.168.1.27 is not allowed to talk to us!

Listen port

[root@clientlinux nrpe-nrpe-3.2.1]# netstat -nap | grep 5666 tcp 0 0 0.0.0.0:5666 0.0.0.0: LIST EN 10646/nrpe tcp 0 0 :::5666 ::: LIST EN 10646/nrpe

iptables

[root@clientlinux nrpe-nrpe-3.2.1]# service iptables status iptables: Firewall is not running.

selinux

[root@clientlinux nrpe-nrpe-3.2.1]# sestatus SELinux status: disabled

status of nrpe

[root@clientlinux nrpe-nrpe-3.2.1]# service nrpe status Checking for nrpe daemon...nrpe (pid 10646) is running...

status of xinetd

[root@clientlinux nrpe-nrpe-3.2.1]# service xinetd status xinetd (pid 7920) is running...

ping to nagios server

2.1]# ping 192.168.1.27 PING 192.168.1.27 (192.168.1.27) 56(84) bytes of data. 64 bytes from 192.168.1.27: icmp_seq=1 ttl=64 time=0.254 ms 64 bytes from 192.168.1.27: icmp_seq=2 ttl=64 time=0.234 ms 64 bytes from 192.168.1.27: icmp_seq=3 ttl=64 time=0.220 ms 64 bytes from 192.168.1.27: icmp_seq=4 ttl=64 time=0.230 ms 64 bytes from 192.168.1.27: icmp_seq=5 ttl=64 time=0.245 ms

status of check_nrpe in remote server

[root@clientlinux nrpe-nrpe-3.2.1]# /usr/local/nagios/libexec/check_nrpe -H 127. 0.0.1 NRPE v3.2.0

Thanks Please let me know what is causing this Screenshot copy the below url and open in your web brower https://i.imgur.com/UFaKu9c.png

box293 commented 6 years ago

How did you install NRPE, did you follow any specific guides?

You seem to be running NRPE as a service. You also reference xinetd, are you trying run it using xinetd? This will cause problems.

indraraj26 commented 6 years ago

Thanks box293 for reply,

I have used following article to install nrpe and nagios on remote host. Copy the below url and open in your web browser LINK : https://www.tecmint.com/how-to-add-linux-host-to-nagios-monitoring-server/ Do you have any shortcut/nice tutorial for nagios ? Thanks a lot

Regards, Indrarajy

box293 commented 6 years ago

I would delete the /etc/xinetd.d/nrpe file and restart the xinetd and nrpe services after doing that.

https://support.nagios.com/kb/article.php?id=515

hedenface commented 6 years ago

Is this still an issue?