Plotting CPU Temperature on MRTG graph
From WBITT's Cooker!
(Difference between revisions)
(Created page with ' ===Create the following script:=== <pre> [root@www mrtg]# cat /usr/local/bin/sensors-mrtg.sh #!/bin/bash SENSORS=/usr/bin/sensors UPTIME=$(uptime | awk -F, '{print $1}' ) TEXT="…') |
(→Detect Sensors (one time activity):) |
||
(One intermediate revision not shown) | |||
Line 1: | Line 1: | ||
+ | ===lm_sensors package must be installed and the service running:=== | ||
+ | |||
+ | <pre> | ||
+ | [root@www mrtg]# rpm -q lm_sensors | ||
+ | lm_sensors-2.10.7-9.el5 | ||
+ | [root@www mrtg]# | ||
+ | |||
+ | service lm_sensors restart | ||
+ | chkconfig --level 35 lm_sensors on | ||
+ | </pre> | ||
+ | |||
+ | ===Detect Sensors (one time activity):=== | ||
+ | <pre> | ||
+ | [root@www mrtg]# sensors-detect | ||
+ | </pre> | ||
+ | |||
+ | Answer the questions with YES, when asked by sensors-detect command. Next, issue "sensors -s" command. After that you can issue the "sensors" command and view the output. | ||
+ | |||
+ | <pre> | ||
+ | [root@www mrtg]# sensors -s | ||
+ | </pre> | ||
+ | |||
+ | <pre> | ||
+ | [root@www mrtg]# sensors | ||
+ | w83793-i2c-0-2f | ||
+ | Adapter: SMBus I801 adapter at 1100 | ||
+ | VCoreA: +1.32 V (min = +0.92 V, max = +1.38 V) | ||
+ | VCoreB: +1.26 V (min = +0.00 V, max = +2.05 V) | ||
+ | Vtt: +1.21 V (min = +1.08 V, max = +1.33 V) | ||
+ | in3: +0.54 V (min = +0.40 V, max = +0.67 V) | ||
+ | in4: +1.82 V (min = +1.62 V, max = +1.98 V) | ||
+ | +3.3V: +3.23 V (min = +2.96 V, max = +3.63 V) | ||
+ | +12V: +12.10 V (min = +10.75 V, max = +13.25 V) | ||
+ | +5V: +5.05 V (min = +4.64 V, max = +5.65 V) | ||
+ | 5VSB: +5.05 V (min = +4.64 V, max = +5.65 V) | ||
+ | VBAT: +3.25 V (min = +2.96 V, max = +3.63 V) | ||
+ | fan1: 0 RPM (min = 712 RPM) ALARM | ||
+ | fan2: 0 RPM (min = 712 RPM) ALARM | ||
+ | fan3: 0 RPM (min = 712 RPM) ALARM | ||
+ | fan4: 0 RPM (min = 712 RPM) ALARM | ||
+ | fan5: 3040 RPM (min = 712 RPM) | ||
+ | fan6: 0 RPM (min = 712 RPM) ALARM | ||
+ | fan7: 2160 RPM (min = 712 RPM) | ||
+ | fan8: 0 RPM (min = 712 RPM) ALARM | ||
+ | fan9: 0 RPM (min = 712 RPM) ALARM | ||
+ | fan10: 0 RPM (min = 712 RPM) ALARM | ||
+ | CPU1 Temp: +26.0°C (high = +75.0°C, hyst = +70.0°C) | ||
+ | CPU2 Temp:-117.5°C (high = +75.0°C, hyst = +70.0°C) | ||
+ | temp3: -119.0°C (high = +75.0°C, hyst = +70.0°C) | ||
+ | temp4: -128.0°C (high = +75.0°C, hyst = +70.0°C) | ||
+ | temp5: +41°C (high = +50°C, hyst = +45°C) | ||
+ | |||
+ | w83627hf-isa-0290 | ||
+ | Adapter: ISA adapter | ||
+ | VCore 1: +0.24 V (min = +1.09 V, max = +1.50 V) ALARM | ||
+ | VCore 2: +0.24 V (min = +1.09 V, max = +1.50 V) ALARM | ||
+ | +3.3V: +0.24 V (min = +2.82 V, max = +3.79 V) ALARM | ||
+ | +5V: +4.97 V (min = +6.85 V, max = +4.97 V) ALARM | ||
+ | +12V: +0.91 V (min = +15.02 V, max = +11.13 V) ALARM | ||
+ | -12V: -13.68 V (min = -3.48 V, max = +3.10 V) ALARM | ||
+ | -5V: -6.96 V (min = +5.10 V, max = +3.69 V) ALARM | ||
+ | V5SB: +5.48 V (min = +6.83 V, max = +4.97 V) ALARM | ||
+ | VBat: +3.23 V (min = +3.94 V, max = +2.46 V) ALARM | ||
+ | fan1: 0 RPM (min = 0 RPM, div = 2) | ||
+ | fan2: 0 RPM (min = 2689 RPM, div = 2) ALARM | ||
+ | fan3: 0 RPM (min = 4470 RPM, div = 2) ALARM | ||
+ | temp1: +122°C (high = -1°C, hyst = -73°C) sensor = thermistor ALARM | ||
+ | temp2: +122.0°C (high = +80°C, hyst = +75°C) sensor = thermistor ALARM | ||
+ | temp3: +122.0°C (high = +80°C, hyst = +75°C) sensor = thermistor ALARM | ||
+ | vid: +1.519 V (VRM Version 11.0) | ||
+ | alarms: Chassis intrusion detection ALARM | ||
+ | beep_enable: | ||
+ | Sound alarm enabled | ||
+ | |||
+ | coretemp-isa-0000 | ||
+ | Adapter: ISA adapter | ||
+ | Core 0: +23°C (high = +85°C) | ||
+ | |||
+ | coretemp-isa-0001 | ||
+ | Adapter: ISA adapter | ||
+ | Core 1: +30°C (high = +85°C) | ||
+ | |||
+ | [root@www mrtg]# | ||
+ | </pre> | ||
===Create the following script:=== | ===Create the following script:=== |
Current revision as of 12:01, 23 May 2010
Contents |
lm_sensors package must be installed and the service running:
[root@www mrtg]# rpm -q lm_sensors lm_sensors-2.10.7-9.el5 [root@www mrtg]# service lm_sensors restart chkconfig --level 35 lm_sensors on
Detect Sensors (one time activity):
[root@www mrtg]# sensors-detect
Answer the questions with YES, when asked by sensors-detect command. Next, issue "sensors -s" command. After that you can issue the "sensors" command and view the output.
[root@www mrtg]# sensors -s
[root@www mrtg]# sensors w83793-i2c-0-2f Adapter: SMBus I801 adapter at 1100 VCoreA: +1.32 V (min = +0.92 V, max = +1.38 V) VCoreB: +1.26 V (min = +0.00 V, max = +2.05 V) Vtt: +1.21 V (min = +1.08 V, max = +1.33 V) in3: +0.54 V (min = +0.40 V, max = +0.67 V) in4: +1.82 V (min = +1.62 V, max = +1.98 V) +3.3V: +3.23 V (min = +2.96 V, max = +3.63 V) +12V: +12.10 V (min = +10.75 V, max = +13.25 V) +5V: +5.05 V (min = +4.64 V, max = +5.65 V) 5VSB: +5.05 V (min = +4.64 V, max = +5.65 V) VBAT: +3.25 V (min = +2.96 V, max = +3.63 V) fan1: 0 RPM (min = 712 RPM) ALARM fan2: 0 RPM (min = 712 RPM) ALARM fan3: 0 RPM (min = 712 RPM) ALARM fan4: 0 RPM (min = 712 RPM) ALARM fan5: 3040 RPM (min = 712 RPM) fan6: 0 RPM (min = 712 RPM) ALARM fan7: 2160 RPM (min = 712 RPM) fan8: 0 RPM (min = 712 RPM) ALARM fan9: 0 RPM (min = 712 RPM) ALARM fan10: 0 RPM (min = 712 RPM) ALARM CPU1 Temp: +26.0°C (high = +75.0°C, hyst = +70.0°C) CPU2 Temp:-117.5°C (high = +75.0°C, hyst = +70.0°C) temp3: -119.0°C (high = +75.0°C, hyst = +70.0°C) temp4: -128.0°C (high = +75.0°C, hyst = +70.0°C) temp5: +41°C (high = +50°C, hyst = +45°C) w83627hf-isa-0290 Adapter: ISA adapter VCore 1: +0.24 V (min = +1.09 V, max = +1.50 V) ALARM VCore 2: +0.24 V (min = +1.09 V, max = +1.50 V) ALARM +3.3V: +0.24 V (min = +2.82 V, max = +3.79 V) ALARM +5V: +4.97 V (min = +6.85 V, max = +4.97 V) ALARM +12V: +0.91 V (min = +15.02 V, max = +11.13 V) ALARM -12V: -13.68 V (min = -3.48 V, max = +3.10 V) ALARM -5V: -6.96 V (min = +5.10 V, max = +3.69 V) ALARM V5SB: +5.48 V (min = +6.83 V, max = +4.97 V) ALARM VBat: +3.23 V (min = +3.94 V, max = +2.46 V) ALARM fan1: 0 RPM (min = 0 RPM, div = 2) fan2: 0 RPM (min = 2689 RPM, div = 2) ALARM fan3: 0 RPM (min = 4470 RPM, div = 2) ALARM temp1: +122°C (high = -1°C, hyst = -73°C) sensor = thermistor ALARM temp2: +122.0°C (high = +80°C, hyst = +75°C) sensor = thermistor ALARM temp3: +122.0°C (high = +80°C, hyst = +75°C) sensor = thermistor ALARM vid: +1.519 V (VRM Version 11.0) alarms: Chassis intrusion detection ALARM beep_enable: Sound alarm enabled coretemp-isa-0000 Adapter: ISA adapter Core 0: +23°C (high = +85°C) coretemp-isa-0001 Adapter: ISA adapter Core 1: +30°C (high = +85°C) [root@www mrtg]#
Create the following script:
[root@www mrtg]# cat /usr/local/bin/sensors-mrtg.sh #!/bin/bash SENSORS=/usr/bin/sensors UPTIME=$(uptime | awk -F, '{print $1}' ) TEXT="CPU Temperature" CPU1TEMP=$( ${SENSORS} | grep "CPU1 Temp" | awk '{print int($3)}' ) # http://people.ee.ethz.ch/~oetiker/webtools/mrtg/reference.html # "The external command must return 4 lines of output: # Line 1 # current state of the first variable, normally 'incoming bytes count' # Line 2 # current state of the second variable, normally 'outgoing bytes count' # Line 3 # string (in any human readable format), telling the uptime of the target. # Line 4 # string, telling the name of the target. " echo ${CPU1TEMP} echo ${CPU1TEMP} echo ${UPTIME} echo ${TEXT} [root@www mrtg]#
Add the following code to your MRTG config file:
Target[CPUTemperature]: `/usr/local/bin/sensors-mrtg.sh` Options[CPUTemperature]: nopercent,growright,unknaszero,gauge MaxBytes[CPUTemperature]: 75 AbsMax[CPUTemperature]: 100 Unscaled[CPUTemperature]: dwmy Title[CPUTemperature]: CPU Temperature PageTop[CPUTemperature]: <H1>CPU Temperature</H1> ShortLegend[CPUTemperature]: Celcius YLegend[CPUTemperature]: Celcius