first version with combined plugin for pressure, temperature, and power

This commit is contained in:
john30
2016-12-10 16:52:10 +01:00
parent b4b41afdcf
commit ccb9d45a3c
2 changed files with 50 additions and 4 deletions
+4 -4
View File
@@ -8,9 +8,9 @@ Personally, I use them for checking mainly temperatures, pressures and earned en
- prerequisite is of course a running munin installation on the local host
- to install the plugins:
- git checkout https://github.com/john30/ebusd-munin.git
- chmod a+x ebusd-munin/plugins/*
- sudo cp ebusd-munin/plugins/* /etc/munin/plugins
- sudo cp ebusd-munin/plugins/* /usr/share/munin/plugins/
- sudo munin-node-configure --shell
- run all "ln -s" commands printed by munin-node-configure
- run all "ln -s" commands printed by munin-node-configure and containing "ebusd_"
- sudo service munin-node reload
- that's it
that's it.
+46
View File
@@ -0,0 +1,46 @@
#!/bin/bash
#%# family=auto
#%# capabilities=autoconf
#%# capabilities=suggest
. $MUNIN_LIBDIR/plugins/plugin.sh
if [ "$1" = "autoconf" ]; then
echo "yes"
exit 0
fi
if [ "$1" = "suggest" ]; then
echo "temp"
echo "press"
echo "power"
exit 0
fi
prefix=`basename "$0"`
if [ "$prefix" = "ebusd_temp" ]; then
sensors="outsidetemp BrineTempInput BrineTempOutput FlowTemp mcFlowTempSensor hwTankTemp"
elif [ "$prefix" = "ebusd_press" ]; then
sensors="BrinePress HeatSystemPress VaporPressHigh VaporPressLow"
else
sensors="ActualEnvironmentPower"
fi
if [ "$1" = "config" ]; then
if [ "$prefix" = "ebusd_temp" ]; then
echo "graph_title ebusd Temperaturen"
echo "graph_vlabel Grad"
elif [ "$prefix" = "ebusd_press" ]; then
echo "graph_title ebusd Drucksensoren"
echo "graph_vlabel Bar"
else
echo "graph_title ebusd Ertrag"
echo "graph_vlabel kW"
fi
echo 'graph_category Heizung'
for sensor in $sensors; do
echo ${prefix}_${sensor}.label $sensor
print_warning ${prefix}_$sensor
print_critical ${prefix}_$sensor
done
exit 0
fi
for sensor in $sensors; do
RESULT=`echo "r $sensor"|nc localhost 8888 2>/dev/null|head -n 1|sed -e 's#;.*$##'`
echo ${prefix}_${sensor}.value $RESULT
done