Page 3 of 3

Re: NRPE Command Not Defined

Posted: Tue Dec 01, 2015 4:15 pm
by jnoble921
hsmith wrote:

Code: Select all

command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 150 -c 200
This shouldn't change. These are hardcoded.

You could change it to:

Code: Select all

command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w $ARG1$ -c $ARG2$
and then it would change after an xinetd reload I'll bet.
That did not seem to work but thank you for the advise. command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 300 -c 400 even if I change those it to this on the remote client it still has 150 and 200

Re: NRPE Command Not Defined

Posted: Tue Dec 01, 2015 6:11 pm
by Box293
Can you check if it is also running as an nrpe service?

Code: Select all

service nrpe status

Re: NRPE Command Not Defined

Posted: Wed Dec 02, 2015 8:34 am
by jnoble921
Box293 wrote:Can you check if it is also running as an nrpe service?

Code: Select all

service nrpe status
Thank you. nrpe appears to be running fine. However I also ran xinetd and there appears to be an error, although it is running. Please see below at the -->.

Code: Select all

[[email protected] jnoble]# service nrpe status -l
Redirecting to /bin/systemctl status  -l nrpe.service
nrpe.service - NRPE
   Loaded: loaded (/usr/lib/systemd/system/nrpe.service; enabled)
   Active: active (running) since Tue 2015-12-01 11:18:06 EST; 21h ago
  Process: 25343 ExecStart=/usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d $NRPE_SSL_OPT (code=exited, status=0/SUCCESS)
 Main PID: 25344 (nrpe)
   CGroup: /system.slice/nrpe.service
           └─25344 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d

Dec 01 11:18:06 192.168.1.52.DOMAIN.local systemd[1]: Stopping NRPE...
Dec 01 11:18:06 192.168.1.52.DOMAIN.local systemd[1]: Starting NRPE...
Dec 01 11:18:06 192.168.1.52.DOMAIN.local nrpe[25344]: Starting up daemon
Dec 01 11:18:06 192.168.1.52.DOMAIN.local nrpe[25344]: Server listening on 0.0.0.0 port 5666.
Dec 01 11:18:06 192.168.1.52.DOMAIN.local nrpe[25344]: Server listening on :: port 5666.
Dec 01 11:18:06 192.168.1.52.DOMAIN.local nrpe[25344]: Listening for connections on port 0
Dec 01 11:18:06 192.168.1.52.DOMAIN.local nrpe[25344]: Allowing connections from: 127.0.0.1,192.168.1.54
Dec 01 11:18:06 192.168.1.52.DOMAIN.local systemd[1]: Started NRPE.
[[email protected] jnoble]# service xinetd status -l
Redirecting to /bin/systemctl status  -l xinetd.service
xinetd.service - Xinetd A Powerful Replacement For Inetd
   Loaded: loaded (/usr/lib/systemd/system/xinetd.service; enabled)
   Active: active (running) since Tue 2015-12-01 16:11:07 EST; 16h ago
  Process: 2861 ExecStart=/usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid $EXTRAOPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 2862 (xinetd)
   CGroup: /system.slice/xinetd.service
           └─2862 /usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid

Dec 01 16:11:07 192.168.1.52.DOMAIN.local xinetd[2862]: removing echo
Dec 01 16:11:07 192.168.1.52.DOMAIN.local xinetd[2862]: removing echo
Dec 01 16:11:07 192.168.1.52.DOMAIN.local xinetd[2862]: removing tcpmux
Dec 01 16:11:07 192.168.1.52.DOMAIN.local xinetd[2862]: removing time
Dec 01 16:11:07 192.168.1.52.DOMAIN.local xinetd[2862]: removing time
Dec 01 16:11:07 192.168.1.52.DOMAIN.local systemd[1]: Started Xinetd A Powerful Replacement For Inetd.
-->Dec 01 16:11:07 192.168.1.52.DOMAIN.local xinetd[2862]: bind failed (Address already in use (errno = 98)). service = nrpe
-->Dec 01 16:11:07 192.168.1.52.DOMAIN.local xinetd[2862]: Service nrpe failed to start and is deactivated.
Dec 01 16:11:07 192.168.1.52.DOMAIN.local xinetd[2862]: xinetd Version 2.3.15 started with libwrap loadavg labeled-networking options compiled in.
Dec 01 16:11:07 192.168.1.52.DOMAIN.local xinetd[2862]: Started working: 1 available service

Re: NRPE Command Not Defined

Posted: Wed Dec 02, 2015 4:29 pm
by lmiltchev
You can run nrpe either as a "standalone" daemon or under xinetd, but not both. I believe this is the reason for the issues that you are having.

Re: NRPE Command Not Defined

Posted: Wed Dec 02, 2015 4:32 pm
by jnoble921
lmiltchev wrote:You can run nrpe either as a "standalone" daemon or under xinetd, but not both. I believe this is the reason for the issues that you are having.
So then I should stop the NRPE service and disable it?

Thank you sorry that was not clear in my tutorial I found.

Re: NRPE Command Not Defined

Posted: Wed Dec 02, 2015 4:43 pm
by hsmith
There shouldn't be an NRPE service if it is running through xinetd. Can you stop that, and then restart xinetd?

Re: NRPE Command Not Defined

Posted: Thu Dec 03, 2015 8:39 am
by jnoble921
Thank you everyone SO much this was really frustrating and took a lot more effort then I thought. I am now able to successfully add commands that I was not before after I stopped the nrpe service.

I hope in time this helps someone else with this problem.

Re: NRPE Command Not Defined

Posted: Thu Dec 03, 2015 10:28 am
by bwallace
Glad we were able to help. We'll lock this thread now and feel free to open another should you require assistance with anything else.