Passing argument to nrpe

6,174

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.

Share:
6,174

Related videos on Youtube

Seena E
Author by

Seena E

Updated on September 18, 2022

Comments

  • Seena E
    Seena E almost 2 years

    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