Passing argument to nrpe

nagiosnrpe

Remote hosts nrpe.conf

command[check_users]=/usr/lib64/nagios/plugins/check_users -w $ARG1$ -c $ARG2$

Monitoring host:

define command{
        command_name check_nrpe
        command_line /usr/lib64/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$
       }

define service{
        use                             local-service         ; Name of service template to use
        hostgroup_name                  linux-servers
        service_description             Current Users
        check_command                   check_nrpe!check_users!15!20
}

I getting usage error with this configuration , please help

Best Answer

Change check_nrpe!check_users!15!20 to check_nrpe!check_users!"15 20".

With your current config, as far as Nagios is concerned:

ARG1 = check_users
ARG2 = 15
ARG3 = 20

But then your command only uses ARG1 and ARG2, so the 20 isn't passed to NRPE.

You want ARG2 to be "15 20", which NRPE will then split into two ARGs on the receiving side.

Related Topic