Page 1 of 1

Install NRPE with out Xinetd

Posted: Thu Nov 16, 2017 11:12 am
by bsivavani
Hi,

We are trying to install NRPE on RHEL 7.3 by following below url

https://support.nagios.com/kb/article/n ... .html#RHEL

while starting the nrpe agent we are seeing below issue

[root@s930l3087 plugins]# systemctl status nrpe.service
● nrpe.service - Nagios Remote Plugin Executor
Loaded: loaded (/usr/lib/systemd/system/nrpe.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2017-11-16 16:04:59 CET; 7s ago
Docs: http://www.nagios.org/documentation
Process: 27706 ExecStopPost=/bin/rm -f /usr/local/nagios/var/nrpe.pid (code=exited, status=0/SUCCESS)
Process: 27704 ExecStart=/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -f (code=exited, status=2)
Main PID: 27704 (code=exited, status=2)

Nov 16 16:04:59 s930l3087 systemd[1]: Started Nagios Remote Plugin Executor.
Nov 16 16:04:59 s930l3087 systemd[1]: Starting Nagios Remote Plugin Executor...
Nov 16 16:04:59 s930l3087 systemd[1]: nrpe.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Nov 16 16:04:59 s930l3087 systemd[1]: Unit nrpe.service entered failed state.
Nov 16 16:04:59 s930l3087 systemd[1]: nrpe.service failed.
[root@s930l3087 plugins]#

Kindly advice ?

Re: Install NRPE with out Xinetd

Posted: Thu Nov 16, 2017 12:04 pm
by npolovenko
Hello, @bsivavani. Do you see any recent errors in /var/log/messages? Can you also upload /usr/local/nagios/etc/nrpe.cfg file?
Also, please make sure that you ran the firewall related commands from the tutorial:

Code: Select all

firewall-cmd --zone=public --add-port=5666/tcp
firewall-cmd --zone=public --add-port=5666/tcp --permanent
After that please run

Code: Select all

service nrpe start
and

Code: Select all

service nrpe status
Let us know the output of this two commands.

Re: Install NRPE with out Xinetd

Posted: Fri Nov 17, 2017 12:42 pm
by bsivavani
Hi,

I made changes to firewall as suggested, but still the same issue.

I didn't find any errors on /var/log/messages.

Please find attached nrpe.cfg file.

Re: Install NRPE with out Xinetd

Posted: Fri Nov 17, 2017 1:23 pm
by lmiltchev
Do you have nrpe running under xinetd by chance? If NPRE is running under xinetd and you try to start it as a standalone daemon, NRPE won't start, and you will see error messages, similar to this one:
Bind to port 5666 on 0.0.0.0 failed: Address already in use.
Is "/etc/xinetd.d/nrpe" file present on your system? If it is, you can remove it:

Code: Select all

rm -f /etc/xinetd.d/nrpe
and restart xinetd:

Code: Select all

systemctl restart xinetd.service
Next, try restarting nrpe:

Code: Select all

systemctl restart nrpe.service
and check its status:

Code: Select all

systemctl status nrpe.service
Also, disable SELinux (at least temporarily) to see if this is causing the issue.

Code: Select all

setenforce 0
Let us know if this helped. Thank you!