Projet

Général

Profil

Paste
Télécharger au format
Statistiques
| Branche: | Révision:

root / plugins / rpi / rpi_temp @ 31412baa

Historique | Voir | Annoter | Télécharger (679 octets)

1 6af19f55 Steve Schnepp
#! /bin/sh
2
# (c) 2013 - LGPL - Steve Schnepp <steve.schnepp@pwkf.org>
3
4
pluginfull="$0"                 # full name of plugin
5
plugin="${0##*/}"               # name of plugin
6
pidfile="$MUNIN_PLUGSTATE/munin.$plugin.pid"
7
cache="$MUNIN_PLUGSTATE/munin.$plugin.value"
8
9
10
if [ ! -r "/sys/class/thermal/thermal_zone0/temp" ]
11
then
12
	echo "# Cannot read CPU Temp"
13
	exit 1
14
fi
15
16
17
if [ "$1" = "config" ]
18
then
19
        cat <<EOF
20
graph_title CPU Temp
21
graph_category system
22
graph_vlabel C
23
thermal_zone0.label Current CPU Temp
24
EOF
25
        exit 0
26
fi
27
28
# values
29
TEMP_MILLI_C=$(cat /sys/class/thermal/thermal_zone0/temp)
30
31 61fe1573 Steve Schnepp
echo thermal_zone0.value $( echo "scale=3; $TEMP_MILLI_C / 1000" | bc )
32 6af19f55 Steve Schnepp
33
exit 0