Check_snmp_apcups Plugin


#1

Hi,

I am using Nagios version 3.0.6 and plugins 1.4.13. Nagios was set up using the quick install guide. I am also using the sample cfg files for the configuration. Downloaded and copied the check_snmp_apcups plugin to the /usr/local/nagios/libexec folder. The plugin works from the command line (./check_snmp_apcups -H XXX.XXX.XXX.XXX -C public). However, I am having trouble figuring out how to set up the cfg files to get this plugin to work from within the Nagios web interface.

Searching here and and elsewhere, I have tried creating a ups.cfg file with the following:

Define the switch that we’ll be monitoring

define host{

    use             generic-switch          ; Inherit default values from a template

    host_name       Symmetra                ; The name we're giving to this device

    alias           Symmetra         ; A longer name associated with the device

    address         xxx.xxx.xxx.xxx           ; IP address of the switch

    hostgroups      ups                     ; Host groups this switch is associated with

    }

###############################################################################
###############################################################################

HOST GROUP DEFINITIONS

###############################################################################
###############################################################################

Create a new hostgroup for switches

define hostgroup{

    hostgroup_name  ups             ; The name of the hostgroup

    alias           ups             ; Long name of the group

    }

###############################################################################
###############################################################################

SERVICE DEFINITIONS

###############################################################################
###############################################################################

Create a service to monitor a ups

define service{

    use                     local-service   ; Inherit values from a template

    host_name               Symmetra        ; The name of the host the service is associated with

    service_description     APC_Monitor     ; The service description

    check_command           check_snmp_apcups! -H $HOSTADDRESS$ -C public   ; The command used to monitor the service

normal_check_interval 5 ; Check the service every 5 minutes under normal conditions

retry_check_interval 1 ; Re-check the service every minute until its final/hard state is determined

    }

I’ve added the following to the commands.cfg file:

Check APC UPS Status

define command{

    command_name    check_snmp_apcups

    command_line    /usr/local/nagios/libexec/check_snmp_apcups -H $HOSTADDRESS$ -C $ARG1$

    }

I’ve tried a number of other statements that would take too long to list. If possible, I would like to know what I need to add to the various files to make this plugin work, or perhaps someone knows of a place I can check that provides examples for configuring plugins for Nagios.

Thanks.