默认情况下,Ubuntu LInux没有安装Lm_Sensors,因此,我们必须自己安装它们。bob@bob-PC:~$ sudo apt install lm-sensors 检测硬件 接下来,我们需要检测安装在电脑上的硬件监控芯片。现在我们可以开始检测电脑的硬件传感器了: bob@bob-PC:~$ sudo sensors-detect # sensors-detect revision 6284 # System: VMware, Inc. VMware Virtual Platform [None] # Board: Intel Corporation 440BX Desktop Reference Platform # Kernel: 4.15.0-30Ubuntu-generic x86_64 # Processor: Intel Core i7-8700 CPU @ 3.20GHz 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?
Lm_sensors是一个 命令 行工具,用于显示所有芯片传感器数据的当前读数,包括CPU温度。默认情况下,Ubuntu LInux没有安装Lm_Sensors,因此,我们必须自己安装它们。
bob@bob-PC:~$ sudo apt install lm-sensors
检测硬件
接下来,我们需要检测安装在电脑上的硬件监控芯片。现在我们可以开始检测电脑的硬件传感器了:
bob@bob-PC:~$ sudo sensors-detect
# sensors-detect revision 6284 (2015-05-31 14:00:33 +0200)
# System: VMware, Inc. VMware Virtual Platform [None]
# Board: Intel Corporation 440BX Desktop Reference Platform
# Kernel: 4.15.0-30Ubuntu-generic x86_64
# Processor: Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz (6/158/10)
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): yes
Silicon Integrated Systems SIS5595... No
VIA VT82C686 Integrated Sensors... No
VIA VT8231 Integrated Sensors... No
AMD K8 thermal sensors... No
AMD Family 10h thermal sensors... No
AMD Family 11h thermal sensors... No
AMD Family 12h and 14h thermal sensors... No
AMD Family 15h thermal sensors... No
AMD Family 16h thermal sensors... No
AMD Family 17h thermal sensors... No
AMD Family 15h power sensors... No
AMD Family 16h power sensors... No
Intel digital thermal sensor... Success!
(driver `coretemp')
Intel AMB FB-DIMM thermal sensor... No
Intel 5500/5520/X58 thermal sensor... No
VIA C7 thermal sensor... No
VIA Nano thermal sensor... No
Some Super I/O chips contain embedded 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): yes
..................
显示cpu温度
可以通过一下命令查看温度数据了:
bob@bob-PC:~$ sensors
iwlwifi_1-virtual-0
Adapter: Virtual device
temp1: +33.0°C
pch_skylake-virtual-0
Adapter: Virtual device
temp1: +38.5°C
BAT0-acpi-0
Adapter: ACPI interface
in0: +12.45 V
coretemp-isa-0000
Adapter: ISA adapter
Package id 0: +39.0°C (high = +100.0°C, crit = +100.0°C)
Core 0: +39.0°C (high = +100.0°C, crit = +100.0°C)
Core 1: +38.0°C (high = +100.0°C, crit = +100.0°C)
thinkpad-isa-0000
Adapter: ISA adapter
fan1: 0 RPM
temp1: +38.0°C
temp2: N/A
temp3: +0.0°C
temp4: +0.0°C
temp5: +0.0°C
temp6: +0.0°C
temp7: +0.0°C
temp8: +0.0°C
BAT1-acpi-0
Adapter: ACPI interface
in0: +12.49 V
acpitz-acpi-0
Adapter: ACPI interface
temp1: +38.0°C (crit = +128.0°C)
还可以使用watch命令实时关注:
bob@bob-PC:~$ watch sensors
使用图形化工具psensor显示cpu温度
使用Psensor,您可以检查以下各项:
主板、CPU传感器和NVidia GPU的温度
硬盘驱动器的温度
风扇的转速
监视CPU使用情况
最新版本的Psensor还为Ubuntu提供了一个applet指示器,因此在Ubuntu上更容易监控硬件温度。您可以选择在顶部面板中显示温度。它甚至可以在温度超过极限时发送桌面通知。
我们可以使用下面的命令安装Psensor:
bob@bob-PC:~/Desktop$ sudo apt install -y psensor
打开ubuntu的launchpad,在里面找到psensor,打开该应用就可以看到多个传感器:
使用图形化工具hardinfo
Hardinfo是Linux中用于在图形化界面中显示硬件信息的工具。可以使用它检测cpu的温度。以下命令安装hardinfo:
bob@bob-PC:~/Desktop$ sudo apt install hardinfo
# 运行一下命令打开hardinfo
bob@bob-PC:~/Desktop$ sudo hardinfo
总结
在本教程中,我们将学习如何从命令行和桌面获取Ubuntu Linux上的CPU温度。
在Linux下可以通过lm_sensors来查看CPU的温度(当然你的硬件首先要支持),要使用这个功能要有内核相关模块(比如I2C)的支持,下面说一下操作方法:
先看一下你的机器上是否安装了lm_sensors,
$ rpm -q lm_sensors
如果没有安装就先安装一下
$ sudo yum install -y lm_sensors
检测传感器:
$ sudo sh -c "yes|sensors-detect"
如果以上步骤没有问题,执行下面的命令就可以查看CPU的温度了:
$ sensors
Adapter: ISA adapter
in0: +1.07 V (min = +0.00 V, max = +4.08 V)
in1: +1.82 V (min = +0.00 V, max = +4.08 V)
in2: +3.36 V (min = +0.00 V, max = +4.08 V)
in3: +2.94 V (min = +0.00 V, max = +4.08 V)
in4: +0.29 V (min = +0.00 V, max = +2.10 V)
in5: +4.08 V (min = +0.00 V, max = +4.08 V) ALARM
in6: +4.08 V (min = +0.00 V, max = +4.08 V) ALARM
in7: +3.07 V (min = +0.00 V, max = +4.08 V)
in8: +3.09 V
fan1: 2463 RPM (min = 0 RPM)
fan2: 0 RPM (min = 0 RPM)
temp1: -55°C (low = +127°C, high = +127°C) sensor = thermistor
temp2: -2°C (low = +127°C, high = +127°C) sensor = thermistor
temp3: +21°C (low = +127°C, high = +127°C) sensor = diode
vid: +2.050 V
coretemp-isa-0000
Adapter: ISA adapter
Core 0: +44°C (high = +100°C)
coretemp-isa-0001
Adapter: ISA adapter
Core 1: +27°C (high = +100°C)
it8718-isa-0290
Adapter: ISA adapter
in0: +1.07 V (min = +0.00 V, max = +4.08 V)
in1: +1.82 V (min = +0.00 V, max = +4.08 V)
in2: +3.36 V (min = +0.00 V, max = +4.08 V)
in3: +2.94 V (min = +0.00 V, max = +4.08 V)
in4: +0.29 V (min = +0.00 V, max = +2.10 V)
in5: +4.08 V (min = +0.00 V, max = +4.08 V) ALARM
in6: +4.08 V (min = +0.00 V, max = +4.08 V) ALARM
in7: +3.07 V (min = +0.00 V, max = +4.08 V)
in8: +3.09 V
fan1: 2463 RPM (min = 0 RPM)
fan2: 0 RPM (min = 0 RPM)
temp1: -55°C (low = +127°C, high = +127°C) sensor = thermistor
temp2: -2°C (low = +127°C, high = +127°C) sensor = thermistor
temp3: +21°C (low = +127°C, high = +127°C) sensor = diode
vid: +2.050 V
coretemp-isa-0000
Adapter: ISA adapter
Core 0: +44°C (high = +100°C)
coretemp-isa-0001
Adapter: ISA adapter
Core 1: +27°C (high = +100°C)
装之后的老电脑改成了linux服务器,运行久了想看看cpu温度什么的。
看是否有kmod-coretemp,没有的话需要安装这个
执行 sensors-detect 命令,选择使用哪些模块,不使用哪些模块,可以一般回车默认选择到底,也可以一路yes到底即可。
使用 sensors 命令可以查看温度
:: Core 0: +32.0°C (high = +80.0°C, crit = +99.0°C)
如果是云服务器或虚拟机中,是取不到sensors传感器参数的。
Linux系统下查看CPU温度的方法是:
__首先打开linux系统,找到查询软件来查看cpu的温度,然后打开终端输入命令:查看相关软件。
接着安装感应器,在感应器里输入安装命令,一路默认即可,直接输入感应器命令即可。
_真实的物理机中温度正常。这些命令执行的过程中,需要你选择是个否,只要直接一路是,就可以查看cpu温度啦。
声明:本网页内容旨在传播知识,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。
E-mail:langhai8@163.com
本文链接:https://www.wumai.net/tianqi/20221223132506.html
下一篇
石榴温度(石榴耐寒温度)