Quote:
Originally Posted by nishith
Dear Friend,
This is my Nagios Server Entry in command.cfg file
Path is :- /usr/local/nagios/etc/objects/commands.cfg
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -n -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ $ARG3$
}
NRPE Installed Remote Client is having below entry.
Path is :- /usr/local/nagios/nrpe.cfg
command[check_disk]=/usr/local/nagios/libexec/check_disk -w 10m -c 2m -x /proc
#command[check_disk]=/usr/local/nagios/libexec/check_disk -c 10m -w 2m
command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
#command[check_load]=/usr/local/nagios/libexec/check_load -c 15,10,5 -w 30,25,20
command[check_swap]=/usr/local/nagios/libexec/check_swap -w 30% -c 10%
#command[check_swap]=/usr/local/nagios/libexec/check_swap -c 30% -w 10%
command[check_procs]=/usr/local/nagios/libexec/check_procs -w 100 -c 200
#command[check_procs]=/usr/local/nagios/libexec/check_procs -c 100 -w 200
command[check_users]=/usr/local/nagios/libexec/check_users -w 20 -c 50
#command[check_users]=/usr/local/nagios/libexec/check_users -c 20 -w 50
Kindly let me know what to do now......
Regards,
Nishith Vyas
|
the number of arguments etc depends on what this check is actually doing.
this is how i check memory.
in commands.cfg
command + 3 args
Code:
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -n -H $HOSTADDRESS$ -t 20 -c $ARG1$ -a $ARG2$ $ARG3$
}
check command in my services.cfg file
command + 3 args. if i ran this on the command line it would be
./check_nrpe -n -H hostname -c check_mem -a 65 70. - this would connect to the remote server and return results.
Code:
check_nrpe!check_mem!65!70
and finally on the local host,
command + 2 args
Code:
command[check_mem]=/usr/local/nagios/libexec/check_mem -w $ARG1$ -c $ARG2$
the arguments in the services.cfg has to match the commands.cfg.
or you can just hard code the args into commands.cfg like -
Code:
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -n -H host -t 20 -c check_mem -a 70 80
}
I have given up trying to explain now.......sorry, i think it is time for you to read the documentation.
It is exactly what i had to do to get it all going