check_ups

I have been all over the forums and search area and everything say to refer to the other…HELP!!

Does anyone have the syntax for the check_ups plugin?
I have 3 APC 2200R UPS with APC917 Network cards installed.

Any help would be appreciated.

Thanks
Jeff

Have you checked this page?

FROM MY COMMAND FILE

‘check_ups’ command definition

define command{
command_name check_ups
command_line $USER1$/check_ups -H $HOSTADDRESS$ -C public
}

FROM MY CHECK FILE

UPS Check

define service{
use local-service
host_name APCUpsRack1
service_description Check UPS
check_command check_ups!$HOSTADDRESS$! -T
}

FROM NAGIOS
Current Status: UNKNOWN (for 0d 0h 3m 51s)
Status Information: Usage:check_ups -H host -u ups -p port] -v variable] -w warn_value] -c crit_value] -to to_sec] -T]

Not sure where to go from here. Any ideas?
Jeff

After some searching I figured out how to use snmp to get the information I wanted from the APC UPS.
Hope this helps.

Jeff.

HERE IT IS:

#------------------------------------------------------------------------------

download net-snmp-5.3.3.pre1.tar.gz from sourceforge.net

tar xzf net-snmp-5.3.3.pre1.tar.gz

cd net-snmp-5.3.3.pre1

./configure

(accept all defaults)

make

make install

download latest nagios-plugins-1.4.13.tar.gz

tar xzf nagios-plugins-1.4.13.tar.gz

cd nagios-plugins-1.4.13

./configure --with-nagios-user=nagios --with-nagios-group=nagios

make

make install

#ADD The following:
#------------------------------------------------------------------------------

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

add the following line to your nagios.cfg file

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

Definitions for monitoring an APC UPS

cfg_file=/usr/local/nagios/etc/objects/apcups.cfg

#------------------------------------------------------------------------------

create the following file in objects folder

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

APCUPS.CFG - CONFIG FILE FOR MONITORING APC UPS

Created: 2009-03-01 - jeff manross

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

HOST DEFINITIONS

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

Define the UPS that we’ll be monitoring

define host{
use generic-switch
host_name MyUps
alias My APC 2200 Main Server
notification_period 24x7
check_period 24x7
contacts nagiosadmin
address 192.168.1.251
}

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

HOST GROUP DEFINITIONS

###############################################################################
define hostgroup{
hostgroup_name apcups
alias apcups
members MyUps
}

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

SERVICE DEFINITIONS

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

Ping UPS

define service{
use local-service
host_name MyUps
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}
define service{
use local-service
host_name MyUps
service_description UPS Capacity
check_command snmp_ups_capacity! -H $HOSTADDRESS$ -C public
}
define service{
use local-service
host_name MyUps
service_description UPS Current
check_command snmp_ups_current! -H $HOSTADDRESS$ -C public
}
define service{
use local-service
host_name MyUps
service_description UPS Freq In
check_command snmp_ups_frequency_in! -H $HOSTADDRESS$ -C public
}
define service{
use local-service
host_name MyUps
service_description UPS Freq Out
check_command snmp_ups_frequency_out! -H $HOSTADDRESS$ -C public
}
define service{
use local-service
host_name MyUps
service_description UPS Load
check_command snmp_ups_load! -H $HOSTADDRESS$ -C public
}
define service{
use local-service
host_name MyUps
service_description UPS Test Date
check_command snmp_ups_lasttest_date! -H $HOSTADDRESS$ -C public
}
define service{
use local-service
host_name MyUps
service_description UPS Test Result
check_command snmp_ups_lasttest_result! -H $HOSTADDRESS$ -C public
}
define service{
use local-service
host_name MyUps
service_description UPS Status
check_command snmp_ups_stat! -H $HOSTADDRESS$ -C public
}
define service{
use local-service
host_name MyUps
service_description UPS RunTime
check_command snmp_ups_runtime! -H $HOSTADDRESS$ -C public
}
define service{
use local-service
host_name MyUps
service_description UPS Temp
check_command snmp_ups_temp! -H $HOSTADDRESS$ -C public
}
define service{
use local-service
host_name MyUps
service_description UPS Volts In
check_command snmp_ups_voltage_in! -H $HOSTADDRESS$ -C public
}
define service{
use local-service
host_name MyUps
service_description UPS Volts Out
check_command snmp_ups_voltage_out! -H $HOSTADDRESS$ -C public
}

#------------------------------------------------------------------------------

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

SNMP CALLS for UPS

add the following lines to your commands.cfg file

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

‘snmp_ups_capacity’ command definition

define command{
command_name snmp_ups_capacity
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o .1.3.6.1.4.1.318.1.1.1.2.2.1.0 -l ‘\Battery Charge’ -u ‘%’
}

‘snmp_ups_current’ command definition

define command{
command_name snmp_ups_current
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o .1.3.6.1.4.1.318.1.1.1.4.2.4.0 -w 30 -c 50 -l ‘\Output Current’ -u ‘\Amperes’
}

‘snmp_ups_frequency_in’ command definition

define command{
command_name snmp_ups_frequency_in
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o .1.3.6.1.4.1.318.1.1.1.3.2.4.0 -l ‘\Input Freq’ -u ‘\Hertz’
}

‘snmp_ups_frequency_out’ command definition

define command{
command_name snmp_ups_frequency_out
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o .1.3.6.1.4.1.318.1.1.1.4.2.2.0 -l ‘\Output Freq’ -u ‘\Hertz’
}

‘snmp_ups_lasttest_date’ command definition

define command{
command_name snmp_ups_lasttest_date
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o .1.3.6.1.4.1.318.1.1.1.7.2.4.0 -l ‘\Last Test Date’
}

‘snmp_ups_lasttest_result’ command definition

define command{
command_name snmp_ups_lasttest_result
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o .1.3.6.1.4.1.318.1.1.1.7.2.3.0 -c 2 -l ‘\1=Pass 2=Fail’
}

‘snmp_ups_load’ command definition

define command{
command_name snmp_ups_load
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o .1.3.6.1.4.1.318.1.1.1.4.2.3.0 -w 60 -c 90 -l ‘\Current Load’ -u ‘%’
}

‘snmp_ups_runtime’ command definition

define command{
command_name snmp_ups_runtime
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o .1.3.6.1.4.1.318.1.1.1.2.2.3.0 ‘\RunTime’
}

‘snmp_ups_stat’ command definition

define command{
command_name snmp_ups_stat
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o .1.3.6.1.4.1.318.1.1.1.2.1.1.0 -w 3 -c 4 -l ‘\Main UPS Status’
}

‘snmp_ups_temp’ command definition

define command{
command_name snmp_ups_temp
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o .1.3.6.1.4.1.318.1.1.1.2.2.2.0 -w 40 -c 45 -l ‘\Internal Temp’ -u ‘\Celsius’
}

‘snmp_ups_voltage_in’ command definition

define command{
command_name snmp_ups_voltage_in
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o .1.3.6.1.4.1.318.1.1.1.3.2.1.0 -l ‘\Output Voltage’ -u ‘\Volts’
}

‘snmp_ups_voltage_out’ command definition

define command{
command_name snmp_ups_voltage_out
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o .1.3.6.1.4.1.318.1.1.1.4.2.1.0 -l ‘\Output Voltage’ -u ‘\Volts’
}