Posts Tagged ‘munin’

RPi Munin Temperatures

Just two weeks ago I upgraded my raspberry pi from the original squeeze image to the newer wheezy based raspbian. Something I tried to do was to get temperature information in munin, but it didn’t seem possible

Today’s update from Eben indicated this was now simples. So, I updated and after reboot the temperature was available from /sys/class/thermal/thermal_zone0/temp.

I’ve put together a quick munin plugin to record this. The temperatures end up getting rounded to the nearest degree, but I think that’s ok.


if [ "$1" == "autoconf" ]; then
     if [ -e /sys/class/thermal/thermal_zone0/temp ]; then
         echo "yes"
         echo "no"
         exit 1
elif [ "$1" == "config" ]; then
     echo "graph_title Raspberry Pi Temperature"
     echo "graph_args --base 1000 -l 0"
     echo "graph_vlabel Temperature in Celsius"
     echo "graph_category Sensors"
     echo "temp.label temp"
     temp=$(cat /sys/class/thermal/thermal_zone0/temp)
     echo "temp.value $((temp/1000))"