From e5ea4ad7271817b81addf13f1d0251b7a0f5d477 Mon Sep 17 00:00:00 2001 From: Radar Date: Thu, 16 Apr 2009 16:52:15 +0200 Subject: [PATCH] Initial version --- plugins/other/snmp__ups_voltage | 34 +++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 plugins/other/snmp__ups_voltage diff --git a/plugins/other/snmp__ups_voltage b/plugins/other/snmp__ups_voltage new file mode 100755 index 00000000..3464389c --- /dev/null +++ b/plugins/other/snmp__ups_voltage @@ -0,0 +1,34 @@ +#!/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}'