Giter Club home page Giter Club logo

check_ups_apc.py's Introduction

APC UPS Nagios Check

This Nagios/Icinga Check provides the ability to query APC UPS devices (aka PowerNet) for current status.

It will output voltages, frequencies, battery state and other values as performance data for tools like pnp4nagios.
Implementation is in Python. You will need Python libraries nagiosplugin and pysnmp as dependencies.

You need to enable the SNMP Agent on your APC device and set a SNMP Read community.

Installation (manual using pip) on your Nagios Host

pip install -r requirements.txt
python setup.py install
ln -s /usr/bin/check_ups_apc /usr/lib/nagios/plugins/check_ups_apc

Installation Debian package

For Debian you can use the provided Debian package. Debian Jessie should be fine without any additional packages. For Debian Wheezy you will need python-configparser from Backports.

Usage example

Nagios Plugin called manually:

./check_ups_apc -H 10.0.0.1 -C public

See check_ups_apc -h for additional command line arguments. Use -vvv to get Debug Output including additional system information.

Using a config file

You can use a config file to change ranges of the warning and critical value ranges for the different monitored devices. The config is expected to be named /etc/check_ups_apc.conf. Use the command line switch --config (-c) to override this behaviour.

The config file must contain sections named after the specified hostname/hostaddress of the device (parameter -H) of the check_ups_apc call. You can list the changed parameters within this section. Non present values will be set to default values.

Example (all values are the default values):

/etc/check_ups_apc.conf

[10.0.0.1]
input_voltage_min_warn = 215
input_voltage_min_crit = 210
input_voltage_max_warn = 240
input_voltage_max_crit = 245

input_frequency_min_warn = 48
input_frequency_min_crit = 47
input_frequency_max_warn = 52
input_frequency_max_crit = 53

output_voltage_min_warn = 215
output_voltage_min_crit = 210
output_voltage_max_warn = 240
output_voltage_max_crit = 245

output_frequency_min_warn = 48
output_frequency_min_crit = 47
output_frequency_max_warn = 52
output_frequency_max_crit = 53

battery_capacity_min_warn = 70
battery_capacity_min_crit = 50

battery_temperature_min_warn = 15
battery_temperature_min_crit = 10
battery_temperature_max_warn = 30
battery_temperature_max_crit = 40

output_load_max_warn = 70
output_load_max_crit = 85

Nagios Integration

Define the commands for Nagios checks and include it in the service definitions:

define command {
	command_name	check_ups_apc
	command_line	/usr/lib/nagios/plugins/check_ups_apc -C $ARG1$ -H $HOSTADDRESS$
}
define service {
	use			generic-service-perfdata
	hostgroup_name		ups_apc
	service_description	check_ups_apc
	check_command		check_ups_apc!SNMP_COMMUNITY
}

check_ups_apc.py's People

Contributors

cygnusb avatar lukas2511 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.