Page 2 of 2

Re: NRPE: Command not defined

Posted: Tue Mar 24, 2020 5:41 pm
by Novooctavian
I hope this is what you are looking for.
service-nonworking.png
service-working.png

Re: NRPE: Command not defined

Posted: Tue Mar 24, 2020 5:54 pm
by Box293
Can you look in your objects.cache file on the Nagios server and locate the service and post that config here please.

I feel like it's not actually a problem with the client but the Nagios server.

Re: NRPE: Command not defined

Posted: Tue Mar 24, 2020 6:05 pm
by Novooctavian
Here you go.

Re: NRPE: Command not defined

Posted: Wed Mar 25, 2020 1:16 pm
by lmiltchev
The "/ Disk Usage" service is configured correctly on the Nagios XI side of things. I am a bit confused about the use of the "-s" flag in your check_nrpe command...
define command {
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -s password -c $ARG1$ $ARG2$
}
Are you passing a password with "-s"? This flag is used for SSL logging. From the plugin's usage:
-s, --ssl-logging=OPTIONS SSL Logging Options
What is really strange is that "check_disk" command is configured properly on the client (remote machine):

Code: Select all

command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$
but you are getting "Command not defined". This command is defined in the /usr/local/nagios/etc/nrpe/common.cfg file, not in the nrpe.cfg, but it should work as you have the following directive in the nrpe.cfg:

Code: Select all

include_dir=/usr/local/nagios/etc/nrpe
The only time check_nrpe "won't see" the command is if you forgot to restart the nrpe daemon. Can you restart nrpe on the remote box, and try your check again? Did it work now?

Does the /etc/xinetd.d/nrpe file exist on the client? If seems like NRPE is running as a standalone daemon, but I would like to make sure of that.

Also, can you double check to make sure that the nrpe.cfg and common.cfg files are the ones from the 172.23.13.43 machine?

Re: NRPE: Command not defined

Posted: Wed Mar 25, 2020 3:29 pm
by Novooctavian
Hi,
I've resolved this issue by removing NRPE completely and reinstalled it with the following:
wget https://assets.nagios.com/downloads/nag ... ent.tar.gz
tar xzf linux-nrpe-agent.tar.gz
cd linux-nrpe-agent
./fullinstall
I do not know why it did not work in the first place. I am going to follow this procedure again on a 3rd server and hopefully, it will go off without a hitch since I am trying to put together some documentation.

Stephanus

Re: NRPE: Command not defined

Posted: Wed Mar 25, 2020 3:32 pm
by lmiltchev
Sounds good! I am glad your issue has been resolved! I will be closing this topic now. If you have any further questions, please start a new thread. Thank you!