如何在Linux上安装LM传感器
LM传感器为Linux提供硬件健康监控驱动程序。
系统管理员使用它来检查其硬件的运行状况。
它还用于监视服务器中的硬件基础架构,在关键任务应用程序中非常有价值。
但配置它使用相对容易。
下面展示如何在Ubuntu/Debian和Fedora Linux发行版上安装LM传感器工具。
1)安装
在Ubuntu和Debian Distrs上
# apt install lm-sensors
在Fedora 26和RPM Linux Distrs
# dnf install lm_sensors
完成安装后,运行以下命令以检查当前的硬件规格。
# sudo sensors-detect
它会问你几个问题。
回答是的,所有这些。
`` [root@localhost bin]# sensors-detect # sensors-detect revision 6284 (2014-05-31 14:00:33 +0200) # System: ASUSTeK COMPUTER INC. X540LA [1.0] (laptop) # Kernel: 4.11.11-300.fc26.x86_64 x86_64 # Processor: Intel(R) Core(TM) i3-5020U CPU @ 2.20GHz (6/61/4) 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 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 /dev/port: Operation not permitted Some hardware monitoring chips are 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): yes /dev/port: Operation not permitted Lastly, we can probe the I2C/SMBus adapters for connected hardware monitoring devices. This is the most risky part, and while it works reasonably well on most systems, it has been reported to cause trouble on some systems. Do you want to probe the I2C/SMBus adapters now? (YES/no): yes Found unknown SMBus adapter 8086:9ca2 at 0000:00:1f.3. Sorry, no supported PCI bus adapters found. Module i2c-dev loaded successfully. Next adapter: i915 gmbus vga (i2c-0) Do you want to scan it? (yes/NO/selectively): yes Next adapter: i915 gmbus dpc (i2c-1) Do you want to scan it? (yes/NO/selectively): yes Next adapter: i915 gmbus dpb (i2c-2) Do you want to scan it? (yes/NO/selectively): yes Next adapter: i915 gmbus dpd (i2c-3) Do you want to scan it? (yes/NO/selectively): yes Next adapter: DPDDC-A (i2c-4) Do you want to scan it? (yes/NO/selectively): yes Next adapter: DPDDC-B (i2c-5) Do you want to scan it? (yes/NO/selectively): yes Next adapter: SMBus I801 adapter at 4040 (i2c-6) Do you want to scan it? (YES/no/selectively): yes 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) Next adapter: Synopsys DesignWare I2C adapter (i2c-7) Do you want to scan it? (YES/no/selectively): yes Adapter doesn't support all probing functions. Some addresses won't be probed. Next adapter: Synopsys DesignWare I2C adapter (i2c-8) Do you want to scan it? (YES/no/selectively): yes Adapter doesn't support all probing functions. Some addresses won't be probed. Now follows a summary of the probes I have just done. Just press ENTER to continue: Driver `coretemp': * Chip `Intel digital thermal sensor' (confidence: 9) Do you want to overwrite /etc/sysconfig/lm_sensors? (YES/no): yes Unloading i2c-dev... OK [root@localhost bin]# ``
测试LM传感器
最后让CPU温度类型传感器在终端中。
该测试是"LM-Sensors""工具正常工作。
此外,要检查CPU温度,风扇速度和其他数据运行以下命令:
[root@localhost bin]# sensors asus-isa-0000 Adapter: ISA adapter cpu_fan: 2100 RPM temp1: +49.0°C acpitz-virtual-0 Adapter: Virtual device temp1: +49.0°C (crit = +108.0°C) coretemp-isa-0000 Adapter: ISA adapter Package id 0: +50.0°C (high = +105.0°C, crit = +105.0°C) Core 0: +49.0°C (high = +105.0°C, crit = +105.0°C) Core 1: +50.0°C (high = +105.0°C, crit = +105.0°C) pch_wildcat_point-virtual-0 Adapter: Virtual device temp1: +47.0°C
该传感器的输出显示了两种设备:华硕-SIA-0000(主板传感器)和CCORETEMP-ISA-0000(英特尔核心传感器)。
主板传感器装置有关于主板(IN1-6)从电源单元接收的电压的信息,风扇速度(具有RPM的条目)和各种内部温度。
2)安装和定制LM-Sensor GUI:Psensor
a)安装Psensor
如果我们不想使用带有终端的LM-Sensor,则可以安装作为LM传感器的GUI的PSENSOR。
在Debian System.
# apt install psensor Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: libappindicator3-1 libdbusmenu-glib4 libdbusmenu-gtk3-4 libindicator3-7 libjson-c3 libxnvctrl0 psensor-common The following NEW packages will be installed: libappindicator3-1 libdbusmenu-glib4 libdbusmenu-gtk3-4 libindicator3-7 libjson-c3 libxnvctrl0 psensor psensor-common
在Redhat系统上,Psensor无法从默认系统存储库中获得,因此,我们需要从源代码编译它。
我们将首先需要安装WGet
# dnf install wget Last metadata expiration check: 0:24:13 ago on Wed 23 Aug 2016 03:54:38 AM UTC. Dependencies resolved. ====================================================================================================================================================== Package Arch Version Repository Size ====================================================================================================================================================== Installing: wget x86_64 1.19.1-3.fc26 fedora 725 k
现在为编译安装所需的软件包
# dnf group install 'Development Tools' Last metadata expiration check: 0:50:12 ago on Wed 23 Aug 2016 03:54:38 AM UTC. Dependencies resolved.
现在我们可以在源代理编写此条件时下载最后一个版本的Psensor(1.2.0)
# wget http://wpitchoune.net/psensor/files/psensor-1.2.0.tar.gz --2016-08-23 04:31:01-- http://wpitchoune.net/psensor/files/psensor-1.2.0.tar.gz Resolving wpitchoune.net (wpitchoune.net)... 92.243.29.231
现在你可以解压缩它
# tar xvf psensor-1.2.0.tar.gz psensor-1.2.0/ psensor-1.2.0/test-driver psensor-1.2.0/ar-lib
现在我们可以编制Psensor
# cd psensor-1.2.0
# ./configure checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /usr/bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes
# make install Making install in doc make[1]: Entering directory '/root/psensor-1.2.0/doc' make[2]: Entering directory '/root/psensor-1.2.0/doc'
b)启动和定制Psensor
既然安装了Psensor,我们可以通过图形菜单启动它以具有如下所示:
我们可以通过在右侧的右侧不敏锐,如下所示,选择图表上的哪些元素如下所示,我们在临时临时临时,Cyp1,Core1和ST500LT012-1DG142
我们有可能编辑Psensor首选项。
你可以编辑
- 首选项:我们可以其中修改工具的启动方式,其接口或者通过Psensor - >首选项的图表演示文稿
- 传感器首选项:在此处可以编辑Psensor工具如何在受监视的服务(如警报)上运行,以便通过Psensor - >传感器首选项(如下所述)的通知或者修改服务的名称
然后,我们可以看到一个可以如下所示的通知
"LM-Sensors"是执行硬件健康检查的非常有用的工具。
但是,由于CLI接口差,大多数用户更喜欢基于GUI的应用程序。
但是,LM-Sensor可以配置为使用GUI工具,例如"传感器 - applet","PSensor",这是一个GTK应用程序,该应用程序显示CPU,HDD温度,风扇速度等的图形。
"LM-Sensors"可以进一步配置为使用"fancontrol"脚本来控制系统粉丝。
这可以很容易地运行sudo pwmconfig
命令并仔细跟踪说明。