Hi,
I have a question. I found a plugin on the /www.nagiosexchange.org (check_cisco_envmon.0.4.pl).
I copy t the file to this directory. "/usr/lib/nagios/plugins/contrib"
I’f added this in the folowing switch file i use to monitor cisco switches
define service{
use generic-service ; Inherit values from a template
host_name SWblcc
service_description envmon
check_command check_cisco_envmon.0.4.pl -C SNMP_rmd
}
If i do the nagios check than i have 1 error
"Error: Service check command ‘check_cisco_envmon.0.4.pl -C SNMP_rmd’ specified in service ‘envmon’ for host ‘SWblcc’ not defined anywhere!
so i got the feeling that i forgot to define something…
Is it posible that some one can help me what to do ?
thx in advanced.
Yes, you need to define a command object (and that is what you reference with your check_command variable in the service object). This is normally done (in v3 at least) in a file called commands.cfg. You can read about it here: nagios.sourceforge.net/docs/3_0/ … ml#command but in a nutshell you probably want something in there along the lines of
define command{
command_name check_cisco_envmon
command_line /usr/lib/nagios/plugins/contrib/check_cisco_envmon.0.4.pl -C SNMP_rmd
}
…however I can’t see how your plugin is then supposed to guess which switch its checking… normally you would also use some sort of IP address or hostname argument, like a -H or something (check your plugin helptext/documentation), and pair that with the ip address macro $HOSTADDRESS$… thus making the command_line variable above now read
Then you want your service definition to read
define service{
use generic-service ; Inherit values from a template
host_name SWblcc
service_description envmon
check_command check_cisco_envmon
}
Had still some trouble with the location of the .pl file.
The verification check was a-ok but i had an error something like "file is missing"
Fist i changed the name of the perl file to check_cisco.pl it looks a bit better.