1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00
Munin-Contrib/plugins/raspberry-pi/rpi_temp

28 lines
501 B
Bash
Executable file

#! /bin/sh
# (c) 2013 - LGPL - Steve Schnepp <steve.schnepp@pwkf.org>
if [ ! -r "/sys/class/thermal/thermal_zone0/temp" ]
then
echo "# Cannot read CPU Temp"
exit 1
fi
if [ "$1" = "config" ]
then
cat <<EOF
graph_title CPU Temp
graph_category system
graph_vlabel C
thermal_zone0.label Current CPU Temp
EOF
exit 0
fi
# values
TEMP_MILLI_C=$(cat /sys/class/thermal/thermal_zone0/temp)
echo "thermal_zone0.value $(echo "$TEMP_MILLI_C" | awk '{printf("%0.3f", $1 / 1000)}')"
exit 0