Page 1 of 1

Variable explainations in check_XX plugins

Posted: Thu Jan 06, 2011 2:07 am
by brian
Hi,

recently, I encountered a issue about nagios check plugins.
e.g. check_snmp_load

in command, when I run ./check_snmp_load.pl -H XXX.XXX.XXX.XXX -C public -T cisco -w 80,80,80 -c 90,95,100
it's ok and return the correct answer like: CPU: 3 3 3 : OK

but when I begin to use switch.cfg and snmp_load.cfg

here is the snmp_load.cfg content i define
define command {
command_name check_snmp_load
command_line $USER1$/check_snmp_load.pl -H $HOSTADDRESS -C $ARG1$ -T $ARG2$ -w $ARG3$ -c $ARG4$
}

I define one service like below:
define service{
use xxxx
host_name xxxx
service_description cpu monitor
check_command check_snmp_load!public!cisco!80,80,80!90,95,100
}

and in Nagios, it prompts me that "Invalid check type (-T)! "
Any one knows what's the problem? -T follow with cisco, in command it's OK, why in nagios it can't work??
any one can explain the variable and format in cfg file for the command? tks!!!

Re: Variable explainations in check_XX plugins

Posted: Thu Jan 06, 2011 2:18 am
by brian
for me, it's so strange, i changed the definition as below, then it works.

define command {
command_name check_snmp_load
command_line $USER1$/check_snmp_load.pl -H $HOSTADDRESS -C $ARG5$ -T $ARG2$ -w $ARG3$ -c $ARG4$
}

define service{
use xxxx
host_name xxxx
service_description cpu monitor
check_command check_snmp_load!cisco!80,80,80!90,95,100 -C public
}


any one can explain the root cause to me? tks!!!!!!!!!!!!!!!!!!!!!!!!!

Re: Variable explainations in check_XX plugins

Posted: Thu Jan 06, 2011 3:26 am
by brian
sorry
i found the explaination by myself
it's here:

http://nagios.sourceforge.net/docs/3_0/ ... l#hostname