Passing custom arguments to Nagios NRPE commands
Posted: Wed Jan 11, 2017 2:42 am
I have custom nagios check for checking database replication. I have defined service for this as follows in services.cfg,
defined command as follows in checkcommands.cfg,
Note : check_londiste is my custom script to check replication status.
I have this nrpe check on client side, that is in /etc/nagios/nrpe.d/check_londiste.cfg,
and from server side I run this command to get the status
if runs fine, but what I need to do is, I would want to give arguments to this check. Like
How can I achieve this ?
Code: Select all
define service {
check_command check_londiste
host_name host01,host02
service_description londiste
use generic-service
}
Code: Select all
define command {
command_name check_londiste
command_line $USER1$/check_nrpe -u -H $HOSTADDRESS$ -c check_londiste
}
I have this nrpe check on client side, that is in /etc/nagios/nrpe.d/check_londiste.cfg,
Code: Select all
command[check_londiste]=/usr/bin/sudo /usr/lib/nagios/plugins/check_londiste
Code: Select all
./check_nrpe -u -H host01 -c check_londiste
Code: Select all
./check_nrpe -u -H host01 -c check_londiste -a $ARG1$ $ARG2$