service nrpe restart

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
donnyforbes
Posts: 357
Joined: Tue Jun 13, 2017 2:17 pm

service nrpe restart

Post by donnyforbes »

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
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: service nrpe restart

Post by dwhitfield »

Did you compile, install from repos, or did you use the instructions at https://assets.nagios.com/downloads/nag ... _Agent.pdf ?

If you compiled, did you use our instructions? https://support.nagios.com/kb/article.php?id=515#CentOS

It might be best to just blow away everything related to NRPE on that server and start over with a known method.
donnyforbes
Posts: 357
Joined: Tue Jun 13, 2017 2:17 pm

Re: service nrpe restart

Post by donnyforbes »

Ok I will use this method https://support.nagios.com/kb/article.php?id=515#CentOS
could you tell me how to blow everything away easily and quickly ?
donnyforbes
Posts: 357
Joined: Tue Jun 13, 2017 2:17 pm

Re: service nrpe restart

Post by donnyforbes »

Ok I got everything remove I will proceed. Thanks
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: service nrpe restart

Post by dwhitfield »

For future reference, I suppose, since I already have it typed up.

Take a look at the output of rpm -qa | grep nrpe. If nothing, then find / -name *nrpe* should give you a list of everything you need to remove.

If rpm does return something, uninstall those packages first, then run the find command and remove everything it finds.
donnyforbes
Posts: 357
Joined: Tue Jun 13, 2017 2:17 pm

Re: service nrpe restart

Post by donnyforbes »

This https://support.nagios.com/kb/article.php?id=515#CentOS worked perfect thanks. Will this work for RHEL 7 as well?
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: service nrpe restart

Post by dwhitfield »

Yes, ***BUT***...make sure you pay attention where the document is broken into 5.x/6.x sections and 7.x sections.
donnyforbes
Posts: 357
Joined: Tue Jun 13, 2017 2:17 pm

Re: service nrpe restart

Post by donnyforbes »

Got it thanks
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: service nrpe restart

Post by dwhitfield »

np. Let us know if you run into any issues.
Locked