linux 温度(Linux软件大全)
linux系统下 如何监控硬件温度
在Linux桌面系统中安装 psensor。
在启动 psensor之前,需要先配置lm_sensors和hddtemp。
lm_sensors配置。
运行以下命令,配置lm_sensors,每一项都选择YES。
$ sudo sensors-detect
这个命令将会探查和检测硬件中嵌入的传感器(包括CPUs、储存控制器、I/O芯片),然后自动决定系统中哪个驱动模块需要载入并监测其温度。
一旦传感器检测完成,需要把检测到的驱动模块添加到/etc配置中,这样才可以在开机时自动加载。
接下来,继续加载必要的模块,如下:
Ubuntu:
$ sudo service module-init-tools start
Debian:
$ sudo/etc/init.d/kmod start
Fedora
$ sudo service lm_sensors start
hddtemp配置
还需要启动hddtemp,监控硬盘驱动器的温度。
运行下列命令,作为一个守护进程启动hddtemp。记得把“/dev/sda”替换成系统上的硬盘驱动器。
$ sudo hddtemp-d/dev/sda
用 psensor监控系统温度
要启动psensor监测温度,只需简单运行:
$ psensor
psensor窗口将显示一个可用的传感器列表,并将传感器中读出的温度可视化显示出来。可以选择性地启用或禁用任意一个传感器。
另外,可以为每个传感器设置警报级别,这样当传感器温度超过某一阈值时,就能得到通知了。
psensor默认使用的温度单位是“摄氏度”,最新的版本(0.7-0.8)支持在摄氏与华氏之间转换温度单位,如果用的版本比较旧(例如
0.6.x)并且不支持温度单位转换,Ubuntu用户可以通过PPA仓库来安装最新版的psensor,Debian用户则可以通过源代码来安装。
Linux系统下监控和调整机器温度
装tp-fancontrol,限制一下gpu的温度
ubuntuCPU的温度cat/proc/cpuinfo
显卡温度有个sensor applet,装了都能显示
在终端里运行cpufreq-info查看CPU信息
sudo cpufreq-selector-c cpu号
或者 sudo cpufreq-set-c cpu号
选择要调整的CPU(因为你的电脑上可能不止一个CPU)
sudo cpufreq-selector-f你所需要的频率
或者 sudo cpufreq-set-f你所需要的频率
调整cpu频率,注意,此处的频率必须是以KHz为单位,并且是可以达到的频率(也就是用cpufreq-info查看到的各个频率)
也可以
sudo cpufreq-selecotr-g模式
或者
suod cpufreq-set-g模式
这里,模式就是执行cpufreq-info后看到的所支持的模式。
比如以下几种:powersave, userspace, ondemand, conservative, performance。
powersave,是无论如何都只会保持最低频率的所谓“省电”模式;
userspace,是自定义频率时的模式,这个是当你设定特定频率时自动转变的;
ondemand,一有cpu计算量的任务,就会立即达到最大频率运行,等执行完毕就立即回到最低频率;
conservative,翻译成保守的,也就是默认的模式,一般选择这个,会自动在频率上下限调整;
performance,顾名思义只注重效率,无论如何一直保持以最大频率运行。
工具:
lm-sensors sensors-applet
手动配置传感器sudo sensors-detect
查看添加的模块less/etc/modules
其他监控软件:
xsensors ksensors
gdesklets gkrellm
硬盘监控hddtemp
如何在Ubuntu Linux中获取CPU温度
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温度。