NRPE Command Not Defined

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.
jnoble921
Posts: 20
Joined: Mon Nov 30, 2015 2:53 pm

Re: NRPE Command Not Defined

Post 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
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: NRPE Command Not Defined

Post by Box293 »

Can you check if it is also running as an nrpe service?

Code: Select all

service nrpe status
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
jnoble921
Posts: 20
Joined: Mon Nov 30, 2015 2:53 pm

Re: NRPE Command Not Defined

Post 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
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NRPE Command Not Defined

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
jnoble921
Posts: 20
Joined: Mon Nov 30, 2015 2:53 pm

Re: NRPE Command Not Defined

Post 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.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: NRPE Command Not Defined

Post by hsmith »

There shouldn't be an NRPE service if it is running through xinetd. Can you stop that, and then restart xinetd?
Former Nagios Employee.
me.
jnoble921
Posts: 20
Joined: Mon Nov 30, 2015 2:53 pm

Re: NRPE Command Not Defined

Post 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.
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: NRPE Command Not Defined

Post 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.
Be sure to check out the Knowledgebase for helpful articles and solutions!
Locked