Projet

Général

Profil

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

root / plugins / other / cputemp @ 4eb89df7

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

1 2b336004 Uwe Menges
#!/bin/sh
2
#
3
# Plugin to graph temperatures based on info from /sys/devices/platform/coretemp.*
4
#
5
# Parameters:
6
#
7
# 	
8
#
9
#%# family=auto
10
#%# capabilities=autoconf
11
12
if [ "$1" = "autoconf" ]; then
13
	if [ -d /sys/devices/platform/coretemp.0 ]; then
14
		echo yes
15
		exit 0
16
	else
17
		echo "no (/sys/devices/platform/coretemp.* not there)"
18
		exit 1
19
	fi
20
fi
21
22
if [ "$1" = "config" ]; then
23
	echo 'graph_title CPU temperature'
24
	echo 'graph_args --base 1000 -l 0'
25
	echo 'graph_vlabel temp in °C'
26
	echo 'graph_category sensors'
27
	echo 'graph_info This graph shows temperatures based on /sys/devices/platform/coretemp.*/.'
28
	echo cputemp.info CPU temperature.
29
	for c in /sys/devices/platform/coretemp.*; do
30
		core=${c#/sys/devices/platform/coretemp.}
31
		label=`cat $c/temp1_label`
32
		echo core${core}.label $label
33
	done
34
fi
35
36
for c in /sys/devices/platform/coretemp.*; do
37
	core=${c#/sys/devices/platform/coretemp.}
38
	temp=$((`cat $c/temp1_input` / 1000))
39
	echo core${core}.value $temp
40
done