如何使用 Linux 监控和显示 CPU 温度?
答案1
正如其他人指出的那样,你需要流明传感器包。我想我应该提一下,除了安装包之外,你还应该运行传感器检测命令来识别需要加载的内核模块。
如果您还没有执行此操作,请手动运行一次并检查它是否检测到计算机上的任何传感器。
$ sudo sensors-detect
# sensors-detect revision 5249 (2008-05-11 22:56:25 +0200)
This program will help you determine which kernel modules you need
to load to use lm_sensors most effectively. It is generally safe
and recommended to accept the default answers to all questions,
unless you know what you're doing.
We can start with probing for (PCI) I2C or SMBus adapters.
Do you want to probe now? (YES/no):
Probing for PCI bus adapters...
Use driver `i2c-i801' for device 0000:00:1f.3: Intel 82801G ICH7
We will now try to load each adapter module in turn.
Module `i2c-i801' already loaded.
If you have undetectable or unsupported I2C/SMBus adapters, you can have
them scanned by manually loading the modules before running this script.
We are now going to do the I2C/SMBus adapter probings. Some chips may
be double detected; we choose the one with the highest confidence
value in that case.
If you found that the adapter hung after probing a certain address,
you can specify that address to remain unprobed.
Next adapter: SMBus I801 adapter at 10c0 (i2c-0)
Do you want to scan it? (YES/no/selectively):
Client found at address 0x50
Probing for `Analog Devices ADM1033'... No
Probing for `Analog Devices ADM1034'... No
Probing for `SPD EEPROM'... Yes
(confidence 8, not a hardware monitoring chip)
Probing for `EDID EEPROM'... No
Client found at address 0x52
Probing for `Analog Devices ADM1033'... No
Probing for `Analog Devices ADM1034'... No
Probing for `SPD EEPROM'... Yes
(confidence 8, not a hardware monitoring chip)
Probing for `EDID EEPROM'... No
Some chips are also accessible through the ISA I/O ports. We have to
write to arbitrary I/O ports to probe them. This is usually safe though.
Yes, you do have ISA I/O ports even if you do not have any ISA slots!
Do you want to scan the ISA I/O ports? (YES/no):
Probing for `National Semiconductor LM78' at 0x290... No
Probing for `National Semiconductor LM78-J' at 0x290... No
Probing for `National Semiconductor LM79' at 0x290... No
Probing for `Winbond W83781D' at 0x290... No
Probing for `Winbond W83782D' at 0x290... No
Probing for `IPMI BMC KCS' at 0xca0... No
Probing for `IPMI BMC SMIC' at 0xca8... No
Some Super I/O chips may also contain sensors. We have to write to
standard I/O ports to probe them. This is usually safe.
Do you want to scan for Super I/O sensors? (YES/no):
Probing for Super-I/O at 0x2e/0x2f
Trying family `National Semiconductor'... No
Trying family `SMSC'... Yes
Found unknown chip with ID 0x2803
Probing for Super-I/O at 0x4e/0x4f
Trying family `National Semiconductor'... No
Trying family `SMSC'... No
Trying family `VIA/Winbond/Fintek'... No
Trying family `ITE'... No
Some south bridges, CPUs or memory controllers may also contain
embedded sensors. Do you want to scan for them? (YES/no):
Silicon Integrated Systems SIS5595... No
VIA VT82C686 Integrated Sensors... No
VIA VT8231 Integrated Sensors... No
AMD K8 thermal sensors... No
AMD K10 thermal sensors... No
Intel Core family thermal sensor... Success!
(driver `coretemp')
Intel AMB FB-DIMM thermal sensor... No
Now follows a summary of the probes I have just done.
Just press ENTER to continue:
Driver `coretemp' (should be inserted):
Detects correctly:
* Chip `Intel Core family thermal sensor' (confidence: 9)
I will now generate the commands needed to load the required modules.
Just press ENTER to continue:
To load everything that is needed, add this to /etc/modules:
#----cut here----
# Chip drivers
coretemp
#----cut here----
Do you want to add these lines automatically? (yes/NO)
如果幸运的话,你的笔记本电脑将支持一系列传感器。如果不是,你仍然可以找到一组用于 CPU 的基本传感器:
$ sensors
acpitz-virtual-0
Adapter: Virtual device
temp1: +40.5°C (crit = +105.0°C)
coretemp-isa-0000
Adapter: ISA adapter
Core 0: +35.0°C (crit = +100.0°C)
coretemp-isa-0001
Adapter: ISA adapter
Core 1: +40.0°C (crit = +100.0°C)
答案2
使用“sensors”(来自 lm-sensors)和“watch”(来自 procps pkg),您可以通过以下命令行实时监控传感器数据:
watch -n 1 -d sensors
这将每 1 秒显示一次传感器,并突出显示与前一秒的差异。
Every 1.0s: /usr/bin/sensors
...
temp1: +55C (high = +50C, hyst = +45C) sensor = thermistor ALARM
temp2: +35.0C (high = +80C, hyst = +75C) sensor = thermistor
temp3: +35.0C (high = +80C, hyst = +75C) sensor = thermistor
答案3
Lm-sensors 是 Linux 的硬件健康监控软件包。它允许您访问温度、电压和风扇速度传感器的信息。它适用于大多数较新的系统。此软件包包含可帮助您设置和读取 lm-sensors 数据的程序。
安装使用:
# sudo apt-get install lm-sensors sensors-applet
使用方法:
# sensors-detect
...
# sensors
V1.5: +2.467 V (min = +1.42 V, max = +1.58 V) ALARM
VCore: +1.479 V (min = +1.48 V, max = +1.63 V) ALARM
V3.3: +3.373 V (min = +3.13 V, max = +3.47 V)
V5: +5.000 V (min = +4.74 V, max = +5.26 V)
V12: +11.734 V (min = +11.38 V, max = +12.62 V)
CPU_Fan: 2299 RPM (min = 4000 RPM) ALARM
fan2: 0 RPM (min = 0 RPM)
fan3: 1057 RPM (min = 0 RPM)
fan4: 0 RPM (min = 0 RPM)
CPU: +41.50°C (low = +10°C, high = +50°C)
Board: +35.25°C (low = +10°C, high = +35°C)
Remote: +35.50°C (low = +10°C, high = +35°C) ALARM
CPU_PWM: 144
Fan2_PWM: 112
Fan3_PWM: 112
vid: +1.550 V (VRM Version 9.0)
或者将该小程序添加到您的任务栏。
您也可以尝试 computertemp 小程序。
计算机温度监视器是 GNOME 桌面的一个小程序,可在屏幕上显示计算机 CPU 和磁盘的温度。
它还允许您将温度记录到文件中。您可以设置警报,在达到温度时通知您。可以将多个监视器添加到面板以监视不同的传感器。它设计为看起来像 CPU Frequency Gnome 小程序,因此它们在面板上相互匹配。
安装使用:
sudo apt-get install computertemp
然后添加到任务栏
答案4
Linux 允许您访问温度信息传感器。它适用于 RH6.2x64。
该驱动程序包含使用 lm-sensors 的读取支持:
类型
modprobe coretemp
sensors