From 588e631209e8e40c210c800d7b6e0c75dc522ed1 Mon Sep 17 00:00:00 2001 From: Alexander Swen Date: Mon, 31 Jan 2011 10:31:06 +0100 Subject: [PATCH] Initial version --- plugins/other/apc_pdu_load | 79 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100755 plugins/other/apc_pdu_load diff --git a/plugins/other/apc_pdu_load b/plugins/other/apc_pdu_load new file mode 100755 index 00000000..111cd037 --- /dev/null +++ b/plugins/other/apc_pdu_load @@ -0,0 +1,79 @@ +#!/bin/sh +# -*- sh -*- + +: << =cut +=head1 NAME + +apc_pdu_load = plugin to show load in Ampere for an apc pdu + +=head1 NOTES + +This is a Munin plugin that shows the load in Ampere for an apc pdu + +=head1 AUTHOR + +Contributed by Alexander Swen + +=head1 LICENSE + +Copyright (c) 2011 Alexander Swen + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; version 2 dated June, +1991. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +=head1 CONFIGURATION +[apc_pdu_load] +env.pdu +env.snmp_community public +env.snmp_version 1 +env.load_oid .1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.1 + +=head1 MAGIC MARKERS + + #%# family=auto + #%# capabilities=autoconf + +=cut + +snmp_version=${snmp_version:-1} +snmp_community=${snmp_community:-public} +load_oid=${load_iod:-.1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.1} + +#. $MUNIN_LIBDIR/plugins/plugin.sh + +if [ -z "${pdu}" ]; then + echo "pdu variable not set" + exit 1 +fi + +[ -n "$1" ] && case $1 in + autoconf) + echo yes + exit 0 + ;; + config) + cat << EOF +graph_title PDU load ${pdu} +graph_args -l 0 +graph_scale yes +graph_vlabel Ampere +graph_category ups +load.label load +EOF + exit 0 + ;; +esac + +/usr/bin/snmpget -v ${snmp_version} -c ${snmp_community} ${pdu} ${load_oid}|awk '{sub (/.*: /, "load.value ");print $1" "$2/10}'