aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-02-06 20:31:38 +0100
committerChristian Weiske <cweiske@cweiske.de>2011-02-06 20:31:38 +0100
commite8fa9ca2d5c29ddba6172cd77acd465d328eef45 (patch)
tree805366f11b1c9a850c9e5c0938b2acf4c9d5fb9e
parentef196cc239d5ea63dc602d8392217e4ef2578ad6 (diff)
downloadusb-wde1-tools-e8fa9ca2d5c29ddba6172cd77acd465d328eef45.tar.gz
usb-wde1-tools-e8fa9ca2d5c29ddba6172cd77acd465d328eef45.zip
munin plugin should basically work nwo
-rwxr-xr-xmunin/usb-wde1_26
1 files changed, 25 insertions, 1 deletions
diff --git a/munin/usb-wde1_ b/munin/usb-wde1_
index f58cc9b..bbfc5ee 100755
--- a/munin/usb-wde1_
+++ b/munin/usb-wde1_
@@ -87,4 +87,28 @@ if [ "$1" = "config" ]; then
done
exit 0
-fi \ No newline at end of file
+fi
+
+#split by semicolons
+OLDIFS="$IFS"
+IFS=";"
+read -r startzeichen zustand zeitstempel\
+ t0 t1 t2 t3 t4 t5 t6 t7\
+ h0 h1 h2 h3 h4 h5 h6 h7\
+ tc hc ws ns rain checksum\
+ < "$logfile"
+IFS=$OLDIFS
+
+#FIXME: check timestamp
+
+if [ "$TYPE" = "temperature" ]; then
+ varprefix=t
+else
+ varprefix=h
+fi
+
+
+for i in $sensors; do
+ eval "value=\$$varprefix$i"
+ echo "sensor$i.value $value"
+done