From: Christian Weiske Date: Sun, 6 Feb 2011 18:56:13 +0000 (+0100) Subject: munin plugin: sensor names in config X-Git-Tag: v1.0.0~42 X-Git-Url: https://git.cweiske.de/usb-wde1-tools.git/commitdiff_plain/ef196cc239d5ea63dc602d8392217e4ef2578ad6 munin plugin: sensor names in config --- diff --git a/munin/usb-wde1_ b/munin/usb-wde1_ index c077ea2..f58cc9b 100755 --- a/munin/usb-wde1_ +++ b/munin/usb-wde1_ @@ -46,8 +46,20 @@ elif [ "$1" = "suggest" ]; then exit 0 fi - +############### #load variables +############### + +# Sensors to display +if [ "$sensors" = "" ]; then + sensors="0 1 2 3 4 5 6 7" +fi +# Sensor names +for i in $sensors; do + code="sensor$i=\${sensor$i:=Sensor $i}" + eval $code +done +# FIXME: Warning/critical values if [ "$1" = "config" ]; then @@ -69,6 +81,10 @@ if [ "$1" = "config" ]; then echo 'graph_category sensors' #FIXME: warning/critical values + for i in $sensors; do + eval "name=\$sensor$i" + echo "sensor$i.label $name" + done exit 0 fi \ No newline at end of file