3
# Plugin to monitor APC environmental units (temperature/humidity)
5
# Usage: Copy or link into /etc/munin/node.d/
10
# autoconf (optional - used by munin-config)
14
# units - DNS names of environmental units
15
# oid - OID Prefix for humidity probes
16
# community - Community to use to access the APC unit
20
# Configuration for temperature or humidity probes
23
type=`echo $0 | sed -e 's/.*_\(.*\)/\1/'`
24
if [ "${type}" = temperature ] ; then
25
TOID="enterprises.318.1.1.10.3.13.1.1.3"
27
LABEL="Celsius Degrees"
30
if [ "${type}" = humidity ] ; then
31
TOID="enterprises.318.1.1.10.3.13.1.1.6"
42
SNMPGET=`which snmpget`
44
if [ "$units" ]; then UNITS=$units ; fi
45
if [ "$oid" ]; then TOID=$oid ; fi
46
if [ "$community" ]; then COMMUNITY=$community ; fi
48
UNITS="rg20-sonde b105-sonde"
50
SNMPOPTS="-Ov -Oq -v1 -c ${COMMUNITY}"
52
if [ "$1" = "autoconf" ]; then
53
if [ -z "${UNITS}" -o -z "${SNMPGET}" ] ; then echo "no" ; exit 1 ; fi
54
for m in ${UNITS} ; do
55
if ping -c1 -q $m >/dev/null 2>&1 ; then continue ; fi
61
if [ "$1" = "config" ]; then
62
echo "graph_title Environmental units (${NAME} probes)"
63
echo "graph_vlabel ${LABEL}"
64
for m in ${UNITS} ; do
65
mm=`echo ${m} | tr '-' '_'`
66
echo "${mm}_${LETTER}1.label $m ${NAME} #1"
67
echo "${mm}_${LETTER}2.label $m ${NAME} #2"
72
for m in ${UNITS} ; do
73
v1=`${SNMPGET} ${SNMPOPTS} $m ${TOID}.1`
74
v2=`${SNMPGET} ${SNMPOPTS} $m ${TOID}.2`
75
mm=`echo ${m} | tr '-' '_'`
76
echo "${mm}_${LETTER}1.value $v1"
77
echo "${mm}_${LETTER}2.value $v2"