Projet

Général

Profil

Révision 80956e26

ID80956e267e15ff9a875d0803f3c7c07abdd3c4f0
Parent a5f44799
Enfant 3bb2c5e2

Ajouté par Diego Elio Pettenò il y a plus de 13 ans

Remove sensors that use lm_sensors. These are already supported by sensors_ in main repository.

Voir les différences:

plugins/sensors/cpu_tmp_sensors
1
#!/bin/sh
2
#
3
# Plugin to monitor the CPU temperature through lm-sensors.
4
# v1.0 (2008-02-15) Oliver Ladner <oli@lugh.ch>
5
# 
6
# Requirements:
7
# 	- A configured lm-sensors installation
8
#       - Supported device (see http://www.lm-sensors.org/wiki/Devices)
9
#       - grep, sed and awk
10
#
11
# Todo:
12
#       - Ability to monitor multiple sensors like fan speeds, voltage etc.
13
#       - Better checks (availabilty of lm-sensors, sensors itself, path names)
14
#
15
# Parameters supported:
16
#
17
# 	config
18
# 	autoconf
19
#
20
# Magic markers:
21
#%# capabilities=autoconf
22

  
23
DETECTED_SENSORS=`sensors -U -A | wc -l`
24

  
25
case $1 in
26
   config)
27
        cat <<'EOM'
28
graph_title CPU temperature
29
graph_vlabel CPU temperature in °C
30
graph_options light
31
graph_info This graph shows CPU temperature in °C
32
temp.label temp
33
temp.draw LINE1
34
graph_category sensors
35
temp.warning 65
36
temp.critical 80
37
EOM
38
        exit 0;;
39
esac
40

  
41
case $1 in
42
   autoconf)
43
        if [ "$DETECTED_SENSORS" -eq 0 ]; then
44
                echo "no"
45
                exit 1
46
        else
47
                echo "yes"
48
                exit 0
49
        fi
50
esac
51
 
52
echo -n "temp.value "
53
sensors | grep 'CPU Temp' | sed 's/[+|°|C]//g' | awk {'print $3'}
plugins/sensors/cputemp
1
#!/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
plugins/sensors/fbdimm_temp
1
#!/bin/sh
2
#
3
# Plugin to graph temperatures based on i5k_amb-isa-0000 FB-DIMM sensor
4
#
5
# Parameters:
6
#
7
# 	
8
#
9
#%# family=auto
10
#%# capabilities=autoconf
11

  
12
SENSORS="/usr/bin/sensors"
13

  
14
if [ "$1" = "autoconf" ]; then
15
	# testing if the i5k FB-DIMM sensors are working. (0->working)
16
	RETVAL=`$SENSORS -A i5k_amb-isa-0000|grep -q DIMM; echo $?`
17
	if [ $RETVAL = 0 ]; then
18
		echo yes
19
		exit 0
20
	else
21
		echo "no (i5k FB-DIMM sensors not working.)"
22
		exit 1
23
	fi
24
fi
25

  
26
if [ "$1" = "config" ]; then
27
	echo 'graph_title FB-DIMM temperature'
28
	echo 'graph_args --base 1000 -l 0'
29
	echo 'graph_vlabel temp in °C'
30
	echo 'graph_category sensors'
31
	echo 'graph_info This graph shows FB-DIMM temperatures based on reports generated by intel 5000 series chipsets.'
32
	echo fbdimmtemp.info FB-DIMM temperature.
33
	$SENSORS -A i5k_amb-isa-0000|grep DIMM|tr -d ":+"|awk -F "." '{print $2}'|awk '{print "ch"$1"dimm"$3".label Channel "$1" DIMM "$3}'
34
	exit 0
35
fi
36

  
37
$SENSORS -A i5k_amb-isa-0000|grep DIMM|tr -d ":+"|awk -F "." '{print $2}'|awk '{print "ch"$1"dimm"$3".value "$4}'
plugins/sensors/k8temp
1
#!/bin/sh
2
#
3
# k8temp
4
#
5
# Plugin to monitor the CPU temperature through lm-sensors
6
# on multicore AMD cpus 
7
#
8
# Author: Marc Schiffbauer <marc@schiffbauer.net>
9
#
10
# Requirements:
11
# 	- A configured lm-sensors installation with k8temp kernel module
12
#	- rewuired shell commands: sensors, grep, sed, uniq, cut
13
#
14
# Parameters supported:
15
#
16
# 	config
17
# 	autoconf
18
#
19
# Magic markers:
20
#%# capabilities=autoconf
21

  
22
# VERSION 1.0
23

  
24
case $1 in
25
	config)
26
		I=1
27
		LAST_CORE=""
28
		echo "graph_title CPU temperature"
29
		echo "graph_vlabel temperature in ?C"
30
		echo "graph_options light"
31
		echo "graph_info This graph shows temperature of all CPU cores in ?C"
32
		echo "graph_category sensors"
33
		sensors -uA | grep "^Core" | while read CORE FOO TEMP REST; do
34
			if [ "$LAST_CORE" == "$CORE" ]; then
35
				I=$((I+1))
36
			else
37
				I=1
38
			fi
39
			LAST_CORE=$CORE
40
			CORE_NUM=$(echo $CORE | sed 's/Core//')
41
			echo "core${CORE_NUM}_${I}.label Core ${CORE_NUM} sensor $I"
42
			#echo "core${CORE_NUM}_${I}.draw LINE1"
43
			echo "core${CORE_NUM}_${I}.warning 65"
44
			echo "core${CORE_NUM}_${I}.critical 80"
45
		done
46
        	exit 0
47
	;;
48
	autoconf)
49
	if [ "$(sensors -uA | grep "^Core" | uniq)" ]; then
50
                echo "yes"
51
                exit 0
52
        else
53
                echo "no"
54
                exit 1
55
        fi
56
esac
57
 
58
sensors -uA | grep "^Core" | while read CORE FOO TEMP REST; do
59
	if [ "$LAST_CORE" == "$CORE" ]; then
60
		I=$((I+1))
61
	else
62
		I=1
63
	fi
64
	LAST_CORE=$CORE
65
	CORE_NUM=$(echo $CORE | sed 's/Core//')
66
	TEMP=$(echo $TEMP | cut -d"." -f1)
67
	echo "core${CORE_NUM}_${I}.value $TEMP"
68
done
69
 

Formats disponibles : Unified diff