In my nrpe_local.cfg
added following command:
command[check_mycommand]=/usr/lib/nagios/plugins/check_command 30 35
and then restarted nrpe daemon.
When I execute this command using nrpe
I'm getting the following error:
NRPE: Command 'check_mycommand' not defined
I used following command to execute:
/usr/lib/nagios/plugins/check_nrpe -H hostname -c check_mycommand
I am unable to get any clue.
In my nrpe_local.cfg
there are 10 more commands added and they are working properly.
NRPE. Nagios Remote Plugin Executor (NRPE) is a Nagios agent that allows remote system monitoring using scripts that are hosted on the remote systems. It allows for monitoring of resources such as disk usage, system load or the number of users currently logged in.
To do this, we need check_nrpe plugin. We can install bunch of Nagios plugins including check_nrpe plugin using the following command. These plugins will be installed to /usr/lib/nagios/plugins. If you see NRPE version as the command output, that means you have successfully configured NREP daemon on the remote host.
In my nrpe_local.cfg added following command:>
command[check_mycommand]=/usr/lib/nagios/plugins/check_command 30 35
Try :
command[check_mycommand]=/usr/lib/nagios/plugins/check_command -w (warningTreshold) -c (criticalTreshold)
/etc/init.d/nagios-nrpe-server restart
And indeed kill all other daemons of nrpe which are already running. The cause could be it is already running by different users which may cause conflicts. eg. nagios-nrpe-server is running under user root and under user nagios
Also make sure you added your Nagios server's IP address to the allowed_hosts in /etc/nagios/nrpe.cfg :
allowed_hosts=<ip address of nagios server>
Else you won't be able to execute external commands with NRPE from Nagios.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With