Debian Nagios NRPE connection refused

730 Views Asked by At

I have already checked some docs from here, but still coundt find the solution. I have a nagios server and a webserver to be monitored (RAM). Debian both Server and plugins are installed correctly. Port 5666 is open in both. As we can see below the webserver is allowing connections from 192.168.0.119 as I configured to allow it.
Output of nrpe.cfg log

Apr 12 13:34:14 webserver2 systemd[1]: Started Nagios Remote Plugin Executor.
Apr 12 13:34:14 webserver2 nrpe[903]: parse_allowed_hosts: parsing the allowed host string >192.168.0.119< to add to ACL list
Apr 12 13:34:14 webserver2 nrpe[903]: parse_allowed_hosts: ADDING this record (192.168.0.119) to ACL list!
Apr 12 13:34:14 webserver2 nrpe[903]: add_ipv4_to_acl: checking ip-address >192.168.0.119<
Apr 12 13:34:14 webserver2 nrpe[903]: add_ipv4_to_acl: ip-address >192.168.0.119< correct, adding.
Apr 12 13:34:14 webserver2 nrpe[903]: parse_allowed_hosts: Record added to ACL list!
Apr 12 13:34:14 webserver2 nrpe[903]: Showing ACL lists for both IP and DOMAIN acl's:
Apr 12 13:34:14 webserver2 nrpe[903]: IP ACL: 192.168.0.119/32 1996531904
Apr 12 13:34:14 webserver2 nrpe[903]: Added command[check_mem]=/usr/lib/nagios/plugins/check_mem -f -w 20 -c 10
Apr 12 13:34:14 webserver2 nrpe[903]: INFO: SSL/TLS initialized. All network traffic will be encrypted. Apr 12 13:34:14 webserver2 nrpe[903]: Starting up daemon
Apr 12 13:34:14 webserver2 nrpe[903]: SETUP_WAIT_CONN FOR: IPv4 address: 127.0.0.1 ((null))
Apr 12 13:34:14 webserver2 nrpe[903]: Server listening on 127.0.0.1 port 5666.
Apr 12 13:34:14 webserver2 nrpe[903]: Listening for connections on port 5666
Apr 12 13:34:14 webserver2 nrpe[903]: Allowing connections from: 192.168.0.119

but when I run below from nagios I got connection refused error.

nagios@nagios:/usr/local/nagios/etc/objects$ /usr/lib/nagios/plugins/check_nrpe -H 192.168.0.166 –c check_mem
connect to address 192.168.0.166 port 5666: Connection refused
connect to host 192.168.0.166 port 5666: Connection refused

of course running locally from webserver (192.168.0.166) works fine
root@webserver2:/usr/lib/nagios/plugins# ./check_mem -f -w 20 -c 10
OK - 91.5% (1870592 kB) free.|TOTAL=2043252KB;;;; USED=172660KB;1634601;1838926;; FREE=1870592KB;;;; CACHES=83440KB;;;;

Can anyone help me with this? Thanks a lot

0

There are 0 best solutions below