From a989e8ce14c0c13fb0f392bcd64a567ad166469d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Tue, 28 Aug 2012 16:37:19 -0700 Subject: [PATCH] Cleanup APC UPS plugins using SNMP. Remove the plugins using snmpwalk to produce their results, as there are three different, Perl-based implementations. Of these, one might not work because it uses net-snmp and thus rely on the presence of some MIB file which might not be present. None of the plugins use Munin::SNMP and none uses multigraph capabilities. --- plugins/snmp/{snmp__ups2_ => snmp__acp_ups2_} | 0 .../{ups/apc__snmp_ => snmp/snmp__apc_ups3_} | 0 plugins/snmp/{snmp__ups_ => snmp__apc_ups_} | 0 plugins/snmp/snmp__ups_battery | 36 ------------------- plugins/snmp/snmp__ups_temp | 29 --------------- plugins/snmp/snmp__ups_voltage | 34 ------------------ 6 files changed, 99 deletions(-) rename plugins/snmp/{snmp__ups2_ => snmp__acp_ups2_} (100%) rename plugins/{ups/apc__snmp_ => snmp/snmp__apc_ups3_} (100%) rename plugins/snmp/{snmp__ups_ => snmp__apc_ups_} (100%) delete mode 100755 plugins/snmp/snmp__ups_battery delete mode 100755 plugins/snmp/snmp__ups_temp delete mode 100755 plugins/snmp/snmp__ups_voltage diff --git a/plugins/snmp/snmp__ups2_ b/plugins/snmp/snmp__acp_ups2_ similarity index 100% rename from plugins/snmp/snmp__ups2_ rename to plugins/snmp/snmp__acp_ups2_ diff --git a/plugins/ups/apc__snmp_ b/plugins/snmp/snmp__apc_ups3_ similarity index 100% rename from plugins/ups/apc__snmp_ rename to plugins/snmp/snmp__apc_ups3_ diff --git a/plugins/snmp/snmp__ups_ b/plugins/snmp/snmp__apc_ups_ similarity index 100% rename from plugins/snmp/snmp__ups_ rename to plugins/snmp/snmp__apc_ups_ diff --git a/plugins/snmp/snmp__ups_battery b/plugins/snmp/snmp__ups_battery deleted file mode 100755 index 30bd1ad2..00000000 --- a/plugins/snmp/snmp__ups_battery +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# -# Plugin to monitor battery from UPS APC 9619 -# 2009/04/10 12:27:02 radar AT aol DOT pl -# -# ln -s /usr/share/munin/plugins/snmp__ups_battery /etc/munin/plugins/snmp_UPS.IP_ups_battery -# -# Magic markers (optional - only used by munin-config and some installation scripts): -#%# family=contrib - -UPSHOST=$(basename $0 | awk -F'_|_' '{print $2}') - -if [ "$1" = "config" ]; then - UPSMODEL=$(snmpwalk -v 2c -c public $UPSHOST .1.3.6.1.4.1.318.1.1.1.1.1.1.0 | awk -F'"|"' '{print $2}') - echo "graph_title $UPSMODEL - Battery" - echo "graph_args --base 1000 -l 0 -u 100" - echo "graph_vlabel %" - echo "graph_scale no" - echo "graph_category sensors" - echo "graph_info This graph shows the battery capacity/load read from $UPSMODEL" - echo "batterycapacity.label Battery Capacity" - echo "batterycapacity.type GAUGE" - echo "batterycapacity.draw LINE3" - echo "batterycapacity.info Battery Capacity" - echo "batterycapacity.colour ff0000" - echo "batteryload.label Battery Load" - echo "batteryload.type GAUGE" - echo "batteryload.draw AREA" - echo "batteryload.info Battery Load" - exit 0 -fi - -echo -n "batterycapacity.value " -snmpwalk -v 2c -c public $UPSHOST .1.3.6.1.4.1.318.1.1.1.2.2.1.0 | awk '{print $NF}' -echo -n "batteryload.value " -snmpwalk -v 2c -c public $UPSHOST .1.3.6.1.4.1.318.1.1.1.4.2.3.0 | awk '{print $NF}' diff --git a/plugins/snmp/snmp__ups_temp b/plugins/snmp/snmp__ups_temp deleted file mode 100755 index a390f09d..00000000 --- a/plugins/snmp/snmp__ups_temp +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# -# Plugin to monitor temperature from UPS APC 9619 -# 2009/04/10 12:27:02 radar AT aol DOT pl -# -# ln -s /usr/share/munin/plugins/snmp__ups_temp /etc/munin/plugins/snmp_UPS.IP_ups_temp -# -# Magic markers (optional - only used by munin-config and some installation scripts): -#%# family=contrib - -UPSHOST=$(basename $0 | awk -F'_|_' '{print $2}') - -if [ "$1" = "config" ]; then - UPSMODEL=$(snmpwalk -v 2c -c public $UPSHOST .1.3.6.1.4.1.318.1.1.1.1.1.1.0 | awk -F'"|"' '{print $2}') - echo "graph_title $UPSMODEL- Temperature" - echo "graph_args --base 1000 -l 0 " - echo "graph_vlabel degrees C" - echo "graph_category sensors" - echo "graph_info This graph shows the temperature read from $UPSMODEL" - echo "temperature.label sensor UPS" - echo "temperature.type GAUGE" - echo "temperature.info Temperature from sensor UPS." - echo "temperature.warning 25" - echo "temperature.critical 30" - exit 0 -fi - -echo -n "temperature.value " -snmpwalk -v 2c -c public $UPSHOST .1.3.6.1.4.1.318.1.1.10.2.3.2.1.4.1 | awk '{print $NF}' diff --git a/plugins/snmp/snmp__ups_voltage b/plugins/snmp/snmp__ups_voltage deleted file mode 100755 index 3464389c..00000000 --- a/plugins/snmp/snmp__ups_voltage +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -# -# Plugin to monitor voltage from UPS APC 9619 -# 2009/04/10 12:27:02 radar AT aol DOT pl -# -# ln -s /usr/share/munin/plugins/snmp__ups_voltage /etc/munin/plugins/snmp_UPS.IP_ups_voltage -# -# Magic markers (optional - only used by munin-config and some installation scripts): -#%# family=contrib - -UPSHOST=$(basename $0 | awk -F'_|_' '{print $2}') - -if [ "$1" = "config" ]; then - UPSMODEL=$(snmpwalk -v 2c -c public $UPSHOST .1.3.6.1.4.1.318.1.1.1.1.1.1.0 | awk -F'"|"' '{print $2}') - echo "graph_title $UPSMODEL - Voltage" - echo "graph_args --base 1000" - echo "graph_vlabel Voltage in (-) / out (+)" - echo "graph_category sensors" - echo "graph_info This graph shows the voltage read from $UPSMODEL" - echo "voltagein.label V" - echo "voltagein.type GAUGE" - echo "voltagein.info Voltage." - echo "voltagein.graph no" - echo "voltageout.label V" - echo "voltageout.type GAUGE" - echo "voltageout.info Voltage." - echo "voltageout.negative voltagein" - exit 0 -fi - -echo -n "voltagein.value " -snmpwalk -v 2c -c public $UPSHOST .1.3.6.1.4.1.318.1.1.1.3.2.1.0 | awk '{print $NF}' -echo -n "voltageout.value " -snmpwalk -v 2c -c public $UPSHOST .1.3.6.1.4.1.318.1.1.1.4.2.1.0 | awk '{print $NF}'