Plugin installation how to

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.

Hi

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 }

HTH

/S

Hi Strides,

I got it thx it help t very much.

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. :frowning:

In the commands.cfg i configured this:

# 'Check_envmon' command definition
define command{
	command_name	check_cisco
	command_line	/usr/lib/nagios/plugins/check_cisco.pl -H $HOSTADDRESS$ -C public
	}

and in the switch file i configured this…
I Copy d this from a other file…

define service{
        use                                    generic-service         ; Name of service template to use
        host_name                        SWblcc
        service_description            CISCO Chassis Environment Check
        is_volatile                          0
        check_period                      24x7
        max_check_attempts          4
        normal_check_interval        3
        retry_check_interval            1
        notification_options             w,u,c,r
        notification_interval             960
        notification_period               24x7
        check_command                  check_cisco
        }

After this it looked ok.
i tested it on the spare switch.
I puled a power suply and after a short wile the errors began to roll.

Thank you very much Strides.