tell about config file
[munin-heatpump.git] / heatpump-dimplex-wpm_
index 9598d0c1d2b8616d2b3b02d41b613a87a19d7bc5..4e1300322627449fce148ca4640e4d82119d7702 100755 (executable)
 
  Symlink heatpump-dimplex-wpm_ as "heatpump-dimplex-wpm_192.168.20.71".
 
 
  Symlink heatpump-dimplex-wpm_ as "heatpump-dimplex-wpm_192.168.20.71".
 
+=head2 EXAMPLE CONFIGURATION
+
+ In /etc/munin/plugin-conf.d/munin-node:
+
+ [heatpump-dimplex-wpm_*]
+  env.host_name Heating
+
 =head1 DEPENDENCIES
 
 =head1 DEPENDENCIES
 
- curl
+ - curl
+ - xsltproc
 
 =head1 AUTHOR
 
 
 =head1 AUTHOR
 
@@ -40,16 +48,21 @@ host=`echo ${0##*/}|sed 's/^.*_//g'`
 
 
 if [ "$1" = "config" ]; then
 
 
 if [ "$1" = "config" ]; then
+    if [ "$host_name" != "" ]; then
+        echo "host_name $host_name"
+    fi
+
     #Outdoor temperature
     echo 'multigraph heatpump_dimplex_wpm_outtemp'
     #Outdoor temperature
     echo 'multigraph heatpump_dimplex_wpm_outtemp'
-    echo 'graph_title Außentemperatur'
+    echo 'graph_title Aussentemperatur'
     echo 'graph_args --base 1000'
     echo 'graph_vlabel °C'
     echo 'graph_info Zeigt die gemessene Außentemperatur an'
     echo 'graph_scale no'
     echo 'graph_category sensors'
 
     echo 'graph_args --base 1000'
     echo 'graph_vlabel °C'
     echo 'graph_info Zeigt die gemessene Außentemperatur an'
     echo 'graph_scale no'
     echo 'graph_category sensors'
 
-    echo 'outtemp.label Außentemperatur'
+    echo 'outtemp.label Aussentemperatur'
+    echo 'outtemp.draw LINE1'
 
     #Heating temperatures
     echo 'multigraph heatpump_dimplex_wpm_heating'
 
     #Heating temperatures
     echo 'multigraph heatpump_dimplex_wpm_heating'
@@ -60,9 +73,12 @@ if [ "$1" = "config" ]; then
     echo 'graph_scale no'
     echo 'graph_category sensors'
 
     echo 'graph_scale no'
     echo 'graph_category sensors'
 
-    echo 'returntargettemp.label Rücklaufsolltemperatur'
-    echo 'returntemp.label Rücklauftemperatur'
+    echo 'returntargettemp.label Ruecklaufsolltemperatur'
+    echo 'returntargettemp.draw LINE2'
+    echo 'returntemp.label Ruecklauftemperatur'
+    echo 'returntemp.draw LINE1'
     echo 'influxtemp.label Vorlauftemperatur'
     echo 'influxtemp.label Vorlauftemperatur'
+    echo 'influxtemp.draw LINE1'
 
     #Water temperature
     echo 'multigraph heatpump_dimplex_wpm_water'
 
     #Water temperature
     echo 'multigraph heatpump_dimplex_wpm_water'
@@ -74,7 +90,9 @@ if [ "$1" = "config" ]; then
     echo 'graph_category sensors'
 
     echo 'watertargettemp.label Solltemperatur'
     echo 'graph_category sensors'
 
     echo 'watertargettemp.label Solltemperatur'
+    echo 'watertargettemp.draw LINE2'
     echo 'watertemp.label Warmwassertemperatur'
     echo 'watertemp.label Warmwassertemperatur'
+    echo 'watertemp.draw LINE1'
 
 
     #On/off states
 
 
     #On/off states
@@ -87,12 +105,60 @@ if [ "$1" = "config" ]; then
     echo 'graph_category sensors'
 
     echo 'reqheating.label Anforderung Heizung'
     echo 'graph_category sensors'
 
     echo 'reqheating.label Anforderung Heizung'
+    echo 'reqheating.draw LINE1'
     echo 'reqwater.label Anforderung Warmwasser'
     echo 'reqwater.label Anforderung Warmwasser'
+    echo 'reqwater.draw LINE1'
+
+    #settings: heating level
+    echo 'multigraph heatpump_dimplex_wpm_heating_level'
+    echo 'graph_title Heizungseinstellung'
+    echo 'graph_args --base 1000 --lower-limit 0 --upper-limit 38'
+    echo 'graph_vlabel Einstellung'
+    echo 'graph_info Shows the heating setting'
+    echo 'graph_scale no'
+    echo 'graph_category settings'
+
+    echo 'circuit1.label Heizkreis 1'
+    echo 'circuit1.draw LINE1'
+
+    #error level
+    echo 'multigraph heatpump_dimplex_wpm_errorlevel'
+    echo 'graph_title Alarme/Fehler'
+    echo 'graph_args --base 1000 --lower-limit 0 --upper-limit 100'
+    echo 'graph_vlabel Fehler'
+    echo 'graph_info Shows the error level'
+    echo 'graph_scale no'
+    echo 'graph_category sensors'
+
+    echo 'errorlevel.label Sammelstoermeldung'
+    echo 'errorlevel.draw LINE1'
+    echo 'errorlevel.critical 0:0'
 
     exit 0
 fi
 
 
     exit 0
 fi
 
-data=`curl -s "http://$host/usr-cgi/xml.cgi?A|1|125|D|1|150|I|1|100" | xsltproc paths.xsl -`
+xml=`curl -fs "http://$host/usr-cgi/xml.cgi?A|1|125|D|1|150|I|1|100"`; ret=$?
+if [ "$ret" -ne 0 ]; then
+    echo "Error fetching data from heatpump server: $host"
+    exit 1
+fi
+
+xslfile=paths.xsl
+if [ ! -f "$xslfile" ]; then
+    shell="`readlink -f "$0"`"
+    path="`dirname "$shell"`"
+    xslfile="$path/paths.xsl"
+    if [ ! -f "$xslfile" ]; then
+        echo 'Could not find paths.xsl'
+        exit 2
+    fi
+fi
+
+data=`echo "$xml" | xsltproc "$xslfile" -`; ret=$?
+if [ "$ret" -ne 0 ]; then
+    echo 'Error running xsltproc'
+    exit 2
+fi
 
 #Outdoor temperature
 echo 'multigraph heatpump_dimplex_wpm_outtemp'
 
 #Outdoor temperature
 echo 'multigraph heatpump_dimplex_wpm_outtemp'
@@ -114,3 +180,12 @@ echo 'multigraph heatpump_dimplex_wpm_states'
 echo reqheating.value `echo "$data" | grep DIGITAL/136 | cut -d" " -f2`
 water=`echo "$data" | grep DIGITAL/140 | cut -d" " -f2`
 echo reqwater.value `echo $(($water * 2))`
 echo reqheating.value `echo "$data" | grep DIGITAL/136 | cut -d" " -f2`
 water=`echo "$data" | grep DIGITAL/140 | cut -d" " -f2`
 echo reqwater.value `echo $(($water * 2))`
+
+#Settings: Heating level
+echo 'multigraph heatpump_dimplex_wpm_heating_level'
+echo circuit1.value `echo "$data" | grep 'INTEGER/1 ' | cut -d" " -f2`
+
+#Error level
+#docs: 8,Analog,Ausgang,Sammelstörmeldung
+echo 'multigraph heatpump_dimplex_wpm_errorlevel'
+echo errorlevel.value `echo "$data" | grep 'ANALOG/8 ' | cut -d" " -f2`