Passing custom arguments to Nagios NRPE commands

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.
Locked
rahuls
Posts: 1
Joined: Wed Jan 11, 2017 2:18 am

Passing custom arguments to Nagios NRPE commands

Post by rahuls »

I have custom nagios check for checking database replication. I have defined service for this as follows in services.cfg,

Code: Select all

define service {
        check_command           check_londiste
        host_name               host01,host02
        service_description     londiste
        use                     generic-service
}
defined command as follows in checkcommands.cfg,

Code: Select all

define command {
        command_name    check_londiste
        command_line    $USER1$/check_nrpe -u -H $HOSTADDRESS$ -c check_londiste
}
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,

Code: Select all

command[check_londiste]=/usr/bin/sudo /usr/lib/nagios/plugins/check_londiste
and from server side I run this command to get the status

Code: Select all

./check_nrpe -u -H host01 -c check_londiste
if runs fine, but what I need to do is, I would want to give arguments to this check. Like

Code: Select all

./check_nrpe -u -H host01 -c check_londiste -a $ARG1$ $ARG2$
How can I achieve this ?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Passing custom arguments to Nagios NRPE commands

Post by tmcdonald »

There are a few things you will need to do in the NRPE compilation and configuration side:

http://www.thegeekstuff.com/2010/12/ena ... arguments/

Give that a read and let us know if you have specific questions on any of the steps.
Former Nagios employee
Locked