Monitor CPU temperature with MRTG

Source: Internet
Author: User
Tags mrtg
Use MRTG to monitor CPU temperature-Linux Enterprise Application-Linux server application information. The following is a detailed description. It's time to roll again in summer ~ I believe many people are concerned about whether their CPU will go on strike due to overheating? Is there any software under Linux that can monitor the temperature?
That is lm-sensor. How can I install it?

If your core version is 2.2.X
Download the i2c and lm-sensor kits.
If your core version is 2.4.X
You only need to download lm-sensor.
For ease of KIT management, I put both files under/usr/local/src.
NOTE: If i2c can be executed in other core versions, it should be compiled into a module, which will be explained later.
Root # cd/usr/local/src
Root # tar zxvfp lm_sensors-2.8.0.tar.gz
Root # tar zxvfp i2c-2.8.0.tar.gz
Root # cd/usr/local/src/i2c-2.8.0
Root # make clean <--- very important, so that no compilation is incomplete.
Root # make dep
Root # make all
Root # make install
In this case, let's pack ic2 and then install lm-sensor.
Root # cd/usr/local/src/lm_sensors-2.8.0
Root # make clean is the same as above. Be sure to perform this step.
Root # make dep
Root # make all
Root # make install
It's easy to connect lm-sensor.
Root #/sbin/depmod-
Modify the file below to load the function library
Root # vi/etc/ld. so. conf
/Usr/local/lib add this line
Root # ldconfig
Root #./prog/mkdev. sh to generate the driver to support what you want to detect
Root # sensors-detect: scan the chipset used by your host
As long as you press Enter all the time, just wait until the following things come out according to its default value.
# ---- Cut here ----
# I2C adapter drivers
Modprobe i2c-isa
# I2C chip drivers
Modprobe w81_1d
Modprobe sis5595
# ---- Cut here ----

To make the sensors modules behave correctly, add these lines to either
/Etc/modules. conf or/etc/conf. modules:

# ---- Cut here ----
# I2C module options
I2c-dev alias char-major-89
# ---- Cut here ----
 
Root # vi/etc/modules. conf
Alias char-major-89 i2c-dev to add this line, boot will load
Root # modprobe i2c-isa
Root # modprobe w81_1d
Root # modprobe sis5595
Load the above three
Root # sensors
W83697hf-isa-0290
Adapter: ISA adapter
Algorithm: ISA algorithm
VCore: + 1.47 V (min = + 0.00 V, max = + 0.00 V) ALARM
+ 3.3 V: + 3.34 V (min = + 2.97 V, max = + 3.63 V)
+ 5 V: + 5.12 V (min = + 4.50 V, max = + 5.48 V)
+ 12 V: + 11.67 V (min = + 10.79 V, max = + 13.11 V)
-12 V:-11.83 V (min =-13.21 V, max =-10.90 V)
-5 V: + 3.53 V (min =-5.51 V, max =-4.51 V) ALARM
V5SB: + 5.58 V (min = + 4.50 V, max = + 5.48 V)
VBat: + 3.15 V (min = + 2.70 V, max = + 3.29 V)
Fan1: 3970 RPM (min = 3000 RPM, div = 2)
Fan2: 0 RPM (min = 3000 RPM, div = 2) ALARM
Temp1: + 40 °C (limit = + 60 °C) sensor = thermistor
Temp2: + 39.5 °C (limit = + 60 °C, hysteresis = + 50 °C) sensor = PII/celon diode
Alarms: Chassis intrusion detection ALARM
Beep_enable:
Sound alarm disabled

Sis5595-isa-8008
Adapter: ISA adapter
Algorithm: ISA algorithm
VCore 1: + 4.08 V (min = + 4.08 V, max = + 4.08 V) ALARM
VCore 2: + 4.08 V (min = + 4.08 V, max = + 4.08 V) ALARM
+ 3.3 V: + 4.08 V (min = + 4.08 V, max = + 4.08 V) ALARM
+ 5 V: + 6.85 V (min = + 6.85 V, max = + 6.85 V) ALARM
Fan1: 0 RPM (min = 0 RPM, div = 8) ALARM
Fan2: 0 RPM (min = 0 RPM, div = 8) ALARM
Temp: + 51 °C (limit = + 51 °C, hysteresis = + 51 °C) ALARM
Alarms: Board temperature input (usually LM75 chips) ALARM
If you do not want to reload the data every time you reactivate the instance, you can write the preceding data into/etc/rc. d/rc. local.
 
When the above stuff runs out, it's half done ??? ?? Integrate RTG
Root # cd/var/www/html/mrtg
Root # mkdir temp
Root # cd temp
Root # vi mrtg. temp
The file content is as follows:
#! /Bin/bash
Cputemp = 'sensors | grep temp1 | awk '{print $2}' | cut-c 2-4 ': Find the row containing temp1 and print 2-4 characters in the second column
Systemp = 'sensors | grep temp2 | awk '{print $2}' | cut-c 2-4 '.
UPtime = '/usr/bin/uptime | awk' {print $3 "" $4 "" $5 }''
Echo $ cputemp
Echo $ systemp
Echo $ UPtime
Echo dc.blue-moon.idv.tw (change to your host name)
 
Root # chmod 755 mrtg. temp change to Executable
Root #./mrtg. temp to see if there is any problem
40
37
18: 52, 2 users,
Dc.blue-moon.idv.tw
Next, write down the following file.
Root # vi mrtg. cfg. temp
WorkDir:/var/www/html/mrtg/temp/
Language: big5

Target [index]: '/var/www/html/mrtg/temp/mrtg. temp'
MaxBytes [index]: 60
Options [index]: gauge, nopercent, growright
YLegend [index]: Temp (degree)
ShortLegend [index]: Degree
LegendO [index]: system temperature;
LegendI [index]: CPU temperature;
Title [index]: Blue-Moon City system temperature table
PageTop [index]:

Blue-Moon City host temperature table


System: RedHat 9.0 + Apache 2.0.40


In this way, you only need to connect to http://yourhost.yourdomain/mrtg/tempcan be connected, and then call again? N
Root #/usr/bin/mrtg/var/www/html/mrtg/temp/mrtg. cfg. temp
Executed three times
Put it in the Schedule
Root # vi/etc/crontab
*/5 * root/usr/bin/mrtg/var/www/html/mrtg/temp/mrtg. cfg. temp>/dev/null 2> & 1
This is a success.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.