Page 1 of 1

Where from the arguments are passing

Posted: Wed Nov 20, 2019 7:27 am
by Pratapa
In our environment there is a remote server which is a Linux server. This server is being monitored by Nagios server.

Following is the portion of the nrpe.cfg file (last few lines of the nrpe.cfg file)

-----------------------------------------------------------------------------------------------------------------------
#command[check_users]=/usr/lib/nagios/plugins/check_users -w $ARG1$ -c $ARG2$
#command[check_load]=/usr/lib/nagios/plugins/check_load -w $ARG1$ -c $ARG2$
#command[check_disk]=/usr/lib/nagios/plugins/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
#command[check_procs]=/usr/lib/nagios/plugins/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$

# local configuration:
# if you'd prefer, you can instead place directives here

#include=/etc/nagios/nrpe_local.cfg

# you can place your config snipplets into nrpe.d/
# only snipplets ending in .cfg will get included

include_dir=/etc/nagios/nrpe.d/
---------------------------------------------------------------------------------------------------------------------------------------

[root@host1 nrpe.d#cd /etc/nagios/nrpe.d
[root@host1 nrpe.d#pwd
/etc/nagios/nrpe.d
[root@host1 nrpe.d]# ls
command-plugins.cfg

[root@host1 nrpe.d]#cat command-plugins.cfg
command[check_memory]=/usr/lib64/nagios/plugins/ce/check_mem.pl -f -w $ARG1$ -c $ARG2$ -C
command[check_proc]=/usr/lib64/nagios/plugins/check_procs -u $ARG1$ -a "$ARG2$" -c $ARG3$
command[check_swap]=/usr/lib64/nagios/plugins/check_swap -w $ARG1$ -c $ARG2$
command[check_toptime]=/usr/lib64/nagios/plugins/ce/check_toptime
command[check_total_procs]=/usr/lib64/nagios/plugins/check_procs $ARG1$ $ARG2$
command[check_users]=/usr/lib64/nagios/plugins/check_users $ARG1$ $ARG2$
command[check_zombie_procs]=/usr/lib64/nagios/plugins/check_procs $ARG1$ $ARG2

I did not understand where from the arguments are passing to this file.
These are not passive checks. Services are in OK state.
Please help me.

Regards,
Pratapa.

Re: Where from the arguments are passing

Posted: Wed Nov 20, 2019 8:13 am
by scottwilkerson
The follow the -a flag when running ./check_nrpe on the nagios server

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H YOURHOST -t 30 -c check_disk -a 20% 10% '/'

Code: Select all

/usr/local/nagios/libexec/check_nrpe -h
...

 -a, --args=LIST              Optional arguments that should be passed to the command,
                              separated by a space. If provided, this must be the last
                              option supplied on the command line.

...