先来装一个软件
sudo apt install lm-sensors
然后,运行 sensors 的配置程序
sudo sensors-detect
一路yes,就配置完成了,类似这样的提示:
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.
Some south bridges, CPUs or memory controllers contain embedded sensors.
Do you want to scan for them? This is totally safe. (YES/no): y
最后,ubuntu命令行下查看CPU温度就 在命令行下执行 sensors
发现我的温度是 50度了,不带风扇的情况下,已经运行超过12个小时了,这个问题还是可以接受的,因为是散热片被动散热。
~$ sensors
coretemp-isa-0000
Adapter: ISA adapter
Core 0: +47.0°C (crit = +100.0°C)
Core 1: +46.0°C (crit = +100.0°C)
w83627uhg-isa-0290
Adapter: ISA adapter
in0: +1.19 V (min = +0.00 V, max = +1.74 V)
in1: +1.06 V (min = +0.06 V, max = +0.00 V) ALARM
AVCC: +5.06 V (min = +4.49 V, max = +5.49 V)
+5V: +5.10 V (min = +4.49 V, max = +5.51 V)
in4: +1.02 V (min = +0.05 V, max = +0.00 V) ALARM
in5: +1.50 V (min = +0.02 V, max = +0.00 V) ALARM
5VSB: +5.06 V (min = +4.49 V, max = +5.49 V)
Vbat: +3.26 V (min = +2.69 V, max = +3.64 V)
fan1: 0 RPM (min = 5273 RPM, div = 128) ALARM
fan2: 0 RPM (min = 0 RPM, div = 128) ALARM
SYSTIN: +40.0°C (high = +1.0°C, hyst = +0.0°C) ALARM sensor = thermal diode
CPUTIN: +41.0°C (high = +80.0°C, hyst = +75.0°C) sensor = thermal diode
intrusion0: ALARM
如果要持续监控温度 可以这么 输入命令
watch -n 1 sensors
这样 就每1秒刷新 一次 sensors 的命令结果,也就是每秒更新 CPU的温度,如果想持续监测一段时间的温度,则可以编写一个脚本,把温度监测结果写入log中,然后分析备用。