--- smeserver-zabbix-agent-0.1/root/var/lib/zabbix/bin/sensors.sensors_fixes 2009-04-24 22:28:07.000000000 +0200 +++ smeserver-zabbix-agent-0.1/root/var/lib/zabbix/bin/sensors 2009-04-26 10:57:55.000000000 +0200 @@ -9,35 +9,45 @@ # # If your motherboard support IPMI and you have the ipmitool package # You can use this: - # Of course, you'll have to adapt this + # Of course, you'll have to adapt command as each controler may report different sensors name + # /usr/bin/ipmitool sdr | grep 'P1 Therm Margin' | cut -d'|' -f 2 | awk '{print $1'} # Else, if your motherboard support lm_sensor, you can use something # like this: - # /usr/bin/sensors | grep temp1 | awk '{print $2'} | sed -e "s/+//g" -e "s/.C//g" + # /usr/bin/sensors | grep temp1 | cut -d':' -f 2 | awk '{print $1'} | sed -e "s/+//g" -e "s/.C//g" # You can also try to get your CPU temperature with acpi: # cat /proc/acpi/thermal_zone/THRM/temperature | awk '{print $2}' + # It's important that your commands return only numerical values + # The default for now is to use IPMI - /usr/bin/ipmitool sdr | grep 'P1 Therm Margin' | cut -d'|' -f 2 | awk '{print $1'} + /usr/bin/ipmitool sdr type Temperature | grep 'P1 Therm Margin' | cut -d'|' -f 2 | awk '{print $1'} ;; cpu1) # This will be the same as the above, but for the second CPU - /usr/bin/ipmitool sdr | grep 'P2 Therm Margin' | cut -d'|' -f 2 | awk '{print $1'} + /usr/bin/ipmitool sdr type Temperature | grep 'P2 Therm Margin' | cut -d'|' -f 2 | awk '{print $1'} ;; mb) # AFAIK, motherboard temperature can be retrieved only with lm_sensor or IPMI - /usr/bin/ipmitool sdr | grep 'Baseboard' | cut -d'|' -f 2 | awk '{print $1'} + /usr/bin/ipmitool sdr type Temperature | grep 'Baseboard' | cut -d'|' -f 2 | awk '{print $1'} + + ;; + ambiant) + # Some IPMI controler also report the ambiant temperature + /usr/bin/ipmitool sdr type Temperature | grep Ambient | cut -d'|' -f 2 | awk '{print $1'} ;; - sd*) - # Here, we want a harddrive temperature, so we'll use hddtemp - /usr/sbin/hddtemp /dev/$KEY | cut -d':' -f 3 | sed -e "s/.C//g" + hd*|sd*) + # Here, we want a harddrive temperature, so we'll use smartctl + # We could also use hddtemp but it doesn't seems to work for a lot of drive, where smartctl do + /usr/sbin/smartctl -a /dev/$KEY | grep Temperature_Celsius | awk '{print $10}' + ;; *) # Else, we tell the server the item is not supported