#!/bin/sh # script munin de monitoring de temperature via TEMPer TEMPER_BIN=`which temper` if [ "$TEMPER_BIN" = "" ] then echo "Can't find temper binary" exit 1 fi OUTPUT=`/usr/bin/temper 2>&1 | grep '[0-9.]C' | sed -r 's/.*\s+([0-9.]+)C.*/\1/'` # Gestion de l'autoconf et de la config if [ "$1" = "autoconf" ]; then if [ "$OUTPUT" = "" ]; then echo "yes" exit 0 else echo "no (temper result not found)" exit 1 fi elif [ "$1" = "config" ] then echo "graph_title Temperature ambiante" echo "graph_args --base 1000 -l 0" echo "graph_vlabel temp in celcius" echo "graph_category sensors" echo "graph_info This graph shows the temperature in degrees Celsius of the ambient air." echo "temper.label Temperature" exit 0 fi echo "temper.value $OUTPUT"