service nrpe restart
Posted: Mon Jun 19, 2017 2:13 pm
I have installed this nrpe client on several RHEL and got this working. I still have two CentOS release 6.6 machines left, but running into an issue.
The issue I am having is as followed.
When trying to test communication with the NRPE daemon so from the NAG sever to the remote Centos Machine I am getting the following error.
[root@nag objects]# /usr/local/nagios/libexec/check_nrpe -H 192.168.1.12
CHECK_NRPE: Error - Could not connect to 192.168.1.12: Connection reset by peer
I checked the /var/log/messages and I am seeing this
Jun 19 12:07:04 proxy4gl nrpe[41146]: Host 192.168.1.186 is not allowed to talk to us!
I have verified the firewall by
[root@proxy4gl xinetd.d]# netstat -an |grep 5666
tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN
tcp 0 0 :::5666 :::* LISTEN
[root@proxy4gl xinetd.d]# netstat -lntu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:662 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:631 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:892 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:2049 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN
I have verified that nrpe is running
[root@proxy4gl xinetd.d]# ps -ef |grep nrpe
nagios 37800 1 0 11:20 ? 00:00:00 /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -f
root 41155 17022 0 12:08 pts/0 00:00:00 grep nrpe
I have modified the following file ..
[root@proxy4gl etc]# cat nrpe.cfg |grep 192.168.1.186
allowed_hosts=127.0.0.1, 192.168.1.186
Another thing I have verified that /etc/xinetd.d was running
[root@proxy4gl etc]# service xinetd status
xinetd (pid 37759) is running...
The strange thing is. In all of my other installs I had the following /etc/xinetd.d/nrpe file that I was able to add the Nag server ip to, however I don't see it on this one. I am not sure why.
[root@proxy4gl etc]# ls /etc/xinetd.d/
chargen-dgram cups-lpd daytime-stream discard-stream echo-stream tcpmux-server time-stream
chargen-stream daytime-dgram discard-dgram echo-dgram rsync time-dgram
I tried to restart nrpe using the following command but it did not work.
[root@proxy4gl etc]# service nrpe restart
nrpe: unrecognized service
Any help would be appreciated. Thanks
The issue I am having is as followed.
When trying to test communication with the NRPE daemon so from the NAG sever to the remote Centos Machine I am getting the following error.
[root@nag objects]# /usr/local/nagios/libexec/check_nrpe -H 192.168.1.12
CHECK_NRPE: Error - Could not connect to 192.168.1.12: Connection reset by peer
I checked the /var/log/messages and I am seeing this
Jun 19 12:07:04 proxy4gl nrpe[41146]: Host 192.168.1.186 is not allowed to talk to us!
I have verified the firewall by
[root@proxy4gl xinetd.d]# netstat -an |grep 5666
tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN
tcp 0 0 :::5666 :::* LISTEN
[root@proxy4gl xinetd.d]# netstat -lntu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:662 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:631 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:892 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:2049 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN
I have verified that nrpe is running
[root@proxy4gl xinetd.d]# ps -ef |grep nrpe
nagios 37800 1 0 11:20 ? 00:00:00 /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -f
root 41155 17022 0 12:08 pts/0 00:00:00 grep nrpe
I have modified the following file ..
[root@proxy4gl etc]# cat nrpe.cfg |grep 192.168.1.186
allowed_hosts=127.0.0.1, 192.168.1.186
Another thing I have verified that /etc/xinetd.d was running
[root@proxy4gl etc]# service xinetd status
xinetd (pid 37759) is running...
The strange thing is. In all of my other installs I had the following /etc/xinetd.d/nrpe file that I was able to add the Nag server ip to, however I don't see it on this one. I am not sure why.
[root@proxy4gl etc]# ls /etc/xinetd.d/
chargen-dgram cups-lpd daytime-stream discard-stream echo-stream tcpmux-server time-stream
chargen-stream daytime-dgram discard-dgram echo-dgram rsync time-dgram
I tried to restart nrpe using the following command but it did not work.
[root@proxy4gl etc]# service nrpe restart
nrpe: unrecognized service
Any help would be appreciated. Thanks