1 |
vip-ire |
1.1 |
--- smeserver-zabbix-agent-0.1/root/var/lib/zabbix/bin/sensors.sensors_fixes 2009-04-24 22:28:07.000000000 +0200 |
2 |
|
|
+++ smeserver-zabbix-agent-0.1/root/var/lib/zabbix/bin/sensors 2009-04-26 10:57:55.000000000 +0200 |
3 |
|
|
@@ -9,35 +9,45 @@ |
4 |
|
|
# |
5 |
|
|
# If your motherboard support IPMI and you have the ipmitool package |
6 |
|
|
# You can use this: |
7 |
|
|
- # Of course, you'll have to adapt this |
8 |
|
|
+ # Of course, you'll have to adapt command as each controler may report different sensors name |
9 |
|
|
+ |
10 |
|
|
# /usr/bin/ipmitool sdr | grep 'P1 Therm Margin' | cut -d'|' -f 2 | awk '{print $1'} |
11 |
|
|
|
12 |
|
|
# Else, if your motherboard support lm_sensor, you can use something |
13 |
|
|
# like this: |
14 |
|
|
- # /usr/bin/sensors | grep temp1 | awk '{print $2'} | sed -e "s/+//g" -e "s/.C//g" |
15 |
|
|
+ # /usr/bin/sensors | grep temp1 | cut -d':' -f 2 | awk '{print $1'} | sed -e "s/+//g" -e "s/.C//g" |
16 |
|
|
|
17 |
|
|
# You can also try to get your CPU temperature with acpi: |
18 |
|
|
# cat /proc/acpi/thermal_zone/THRM/temperature | awk '{print $2}' |
19 |
|
|
|
20 |
|
|
+ # It's important that your commands return only numerical values |
21 |
|
|
+ |
22 |
|
|
# The default for now is to use IPMI |
23 |
|
|
- /usr/bin/ipmitool sdr | grep 'P1 Therm Margin' | cut -d'|' -f 2 | awk '{print $1'} |
24 |
|
|
+ /usr/bin/ipmitool sdr type Temperature | grep 'P1 Therm Margin' | cut -d'|' -f 2 | awk '{print $1'} |
25 |
|
|
|
26 |
|
|
;; |
27 |
|
|
cpu1) |
28 |
|
|
# This will be the same as the above, but for the second CPU |
29 |
|
|
|
30 |
|
|
- /usr/bin/ipmitool sdr | grep 'P2 Therm Margin' | cut -d'|' -f 2 | awk '{print $1'} |
31 |
|
|
+ /usr/bin/ipmitool sdr type Temperature | grep 'P2 Therm Margin' | cut -d'|' -f 2 | awk '{print $1'} |
32 |
|
|
|
33 |
|
|
;; |
34 |
|
|
mb) |
35 |
|
|
# AFAIK, motherboard temperature can be retrieved only with lm_sensor or IPMI |
36 |
|
|
|
37 |
|
|
- /usr/bin/ipmitool sdr | grep 'Baseboard' | cut -d'|' -f 2 | awk '{print $1'} |
38 |
|
|
+ /usr/bin/ipmitool sdr type Temperature | grep 'Baseboard' | cut -d'|' -f 2 | awk '{print $1'} |
39 |
|
|
+ |
40 |
|
|
+ ;; |
41 |
|
|
+ ambiant) |
42 |
|
|
+ # Some IPMI controler also report the ambiant temperature |
43 |
|
|
+ /usr/bin/ipmitool sdr type Temperature | grep Ambient | cut -d'|' -f 2 | awk '{print $1'} |
44 |
|
|
|
45 |
|
|
;; |
46 |
|
|
- sd*) |
47 |
|
|
- # Here, we want a harddrive temperature, so we'll use hddtemp |
48 |
|
|
- /usr/sbin/hddtemp /dev/$KEY | cut -d':' -f 3 | sed -e "s/.C//g" |
49 |
|
|
+ hd*|sd*) |
50 |
|
|
+ # Here, we want a harddrive temperature, so we'll use smartctl |
51 |
|
|
+ # We could also use hddtemp but it doesn't seems to work for a lot of drive, where smartctl do |
52 |
|
|
+ /usr/sbin/smartctl -a /dev/$KEY | grep Temperature_Celsius | awk '{print $10}' |
53 |
|
|
+ |
54 |
|
|
;; |
55 |
|
|
*) |
56 |
|
|
# Else, we tell the server the item is not supported |