aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-02-06 19:56:13 +0100
committerChristian Weiske <cweiske@cweiske.de>2011-02-06 19:56:13 +0100
commitef196cc239d5ea63dc602d8392217e4ef2578ad6 (patch)
treeb7a1a71603c4b2351cdd70613990554dd1319d87
parent34039bfad476a917201c56883645e4fbf551b4c7 (diff)
downloadusb-wde1-tools-ef196cc239d5ea63dc602d8392217e4ef2578ad6.tar.gz
usb-wde1-tools-ef196cc239d5ea63dc602d8392217e4ef2578ad6.zip
munin plugin: sensor names in config
-rwxr-xr-xmunin/usb-wde1_18
1 files changed, 17 insertions, 1 deletions
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