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

Contents of /rpms/smeserver-zabbix-agent/contribs9/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)
Tue Feb 9 23:18:26 2016 UTC (8 years, 2 months ago) by stephdl
Branch: MAIN
CVS Tags: smeserver-zabbix-agent-0_1-53_el6_sme, smeserver-zabbix-agent--, HEAD
* Wed Feb 10 stephane de Labrusse <stephdl@de-labrusse.fr> - 0.1-53.sme
- New rpm for sme9

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