2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00
contrib-munin/plugins/other/cputemp
2011-12-18 15:10:08 +01:00

41 lines
962 B
Bash
Executable File

#!/bin/sh
#
# Plugin to graph temperatures based on info from /sys/devices/platform/coretemp.*
#
# Parameters:
#
#
#
#%# family=auto
#%# capabilities=autoconf
if [ "$1" = "autoconf" ]; then
if [ -d /sys/devices/platform/coretemp.0 ]; then
echo yes
exit 0
else
echo "no (/sys/devices/platform/coretemp.* not there)"
exit 1
fi
fi
if [ "$1" = "config" ]; then
echo 'graph_title CPU temperature'
echo 'graph_args --base 1000 -l 0'
echo 'graph_vlabel temp in °C'
echo 'graph_category sensors'
echo 'graph_info This graph shows temperatures based on /sys/devices/platform/coretemp.*/.'
echo cputemp.info CPU temperature.
for c in /sys/devices/platform/coretemp.*; do
core=${c#/sys/devices/platform/coretemp.}
label=`cat $c/temp1_label`
echo core${core}.label $label
done
fi
for c in /sys/devices/platform/coretemp.*; do
core=${c#/sys/devices/platform/coretemp.}
temp=$((`cat $c/temp1_input` / 1000))
echo core${core}.value $temp
done