/[smecontribs]/rpms/smeserver-zabbix-agent/contribs7/smeserver-zabbix-agent-0.1-sensors_fixes.patch
ViewVC logotype

Contents of /rpms/smeserver-zabbix-agent/contribs7/smeserver-zabbix-agent-0.1-sensors_fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Fri Apr 24 12:58:39 2009 UTC (15 years ago) by vip-ire
Branch: MAIN
CVS Tags: smeserver-zabbix-agent-0_1-34_el4_sme, smeserver-zabbix-agent-0_1-35_el4_sme, smeserver-zabbix-agent-0_1-46_el4_sme, smeserver-zabbix-agent-0_1-42_el4_sme, smeserver-zabbix-agent-0_1-41_el4_sme, smeserver-zabbix-agent-0_1-49_el4_sme, smeserver-zabbix-agent-0_1-38_el4_sme, smeserver-zabbix-agent-0_1-47_el4_sme, smeserver-zabbix-agent-0_1-30_el4_sme, smeserver-zabbix-agent-0_1-50_el4_sme, smeserver-zabbix-agent-0_1-32_el4_sme, smeserver-zabbix-agent-0_1-39_el4_sme, smeserver-zabbix-agent-0_1-45_el4_sme, smeserver-zabbix-agent-0_1-51_el4_sme, smeserver-zabbix-agent-0_1-29_el4_sme, smeserver-zabbix-agent-0_1-44_el4_sme, smeserver-zabbix-agent-0_1-52_el4_sme, smeserver-zabbix-agent-0_1-28_el4_sme, smeserver-zabbix-agent-0_1-48_el4_sme, smeserver-zabbix-agent-0_1-36_el4_sme, smeserver-zabbix-agent-0_1-37_el4_sme, smeserver-zabbix-agent-0_1-33_el4_sme, smeserver-zabbix-agent-0_1-43_el4_sme, smeserver-zabbix-agent-0_1-31_el4_sme, smeserver-zabbix-agent-0_1-40_el4_sme, HEAD
see changelog

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

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed