无论是家用电脑还是服务器一直不变的需要解决的问题就是降温,而在平时服务器运行过程中如何知道服务器的内部降温系统是否健康,温度是否正常就可以通过lm_sensors工具进行监测,lm_sensors是一款linux的硬件监控软件,它可以通过打印温度传感器的信息,帮助我们监控主板,CPU的工作电压,风扇转速、温度等数据。这些数据我们通产在主板的BIOS也可以看到。当我们可以在机器运行的时候通过lm_sensors随时来监测CPU的温度变化,可以预防和保护因为CPU过热而烧掉,至于lm_sensors的安装也比较简单,在这里就做简单,在配置好相应的源后可以直接安装,在这里简单描述一下lm_sensors的安装配置。

[root@lsy script 20:58:23]# rpm -qa lm_sensors
lm_sensors-3.4.0-8.20160601gitf9185e5.el7.x86_64
[root@lsy script 20:58:32]# 
[root@lsy script 20:58:33]# 
[root@lsy script 20:58:33]# 
[root@lsy script 20:58:33]# sensors-detect
# sensors-detect revision 3.4.0-8 (2016-06-01)
# System: VMware, Inc. VMware Virtual Platform [None]
# Board: Intel Corporation 440BX Desktop Reference Platform
# Kernel: 3.10.0-957.el7.x86_64 x86_64
# Processor: Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz (6/158/9)

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...                             No
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
Probing for Super-I/O at 0x2e/0x2f
Trying family `National Semiconductor/ITE'...               Yes
Found unknown chip with ID 0x0200
Probing for Super-I/O at 0x4e/0x4f
Trying family `National Semiconductor/ITE'...               No
Trying family `SMSC'...                                     No
Trying family `VIA/Winbond/Nuvoton/Fintek'...               No
Trying family `ITE'...                                      No

Some systems (mainly servers) implement IPMI, a set of common interfaces
through which system health data may be retrieved, amongst other things.
We first try to get the information from SMBIOS. If we don't find it
there, we have to read from arbitrary I/O ports to probe for such
interfaces. This is normally safe. Do you want to scan for IPMI
interfaces? (YES/no): YES
Probing for `IPMI BMC KCS' at 0xca0...                      No
Probing for `IPMI BMC SMIC' at 0xca8...                     No

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
Probing for `National Semiconductor LM78' 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

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
Using driver `i2c-piix4' for device 0000:00:07.3: Intel 82371AB PIIX4 ACPI

Sorry, no sensors were detected.
Either your system has no sensors, or they are not supported, or
they are connected to an I2C or SMBus adapter that is not
supported. If you find out what chips are on your board, check
https://hwmon.wiki.kernel.org/device_support_status for driver status.
[root@lsy script 20:58:51]# 

可能是因为我的实验环境是虚拟机的缘故,导致没有找到传感器。

抱歉,未检测到传感器。

您的系统没有传感器,或者不支持传感器,或者

它们连接到I2C或SMBus适配器

支持。如果你发现你的板上有什么芯片,检查一下

驱动程序状态的https://hwmon.wiki.kernel.org/device_support_status。

查看服务状态,我的应该是有问题的。

[root@lsy zabbix_agentd.d 22:26:29]# systemctl  status  lm_sensors
● lm_sensors.service - Initialize hardware monitoring sensors
   Loaded: loaded (/usr/lib/systemd/system/lm_sensors.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2020-04-13 04:31:01 EDT; 17h ago
 Main PID: 11737 (code=exited, status=1/FAILURE)

Apr 13 04:31:01 lsy systemd[1]: Starting Initialize hardware monitoring sensors...
Apr 13 04:31:01 lsy modprobe[11736]: No sensors with loadable kernel modules configured.
Apr 13 04:31:01 lsy modprobe[11736]: Please, run 'sensors-detect' as root in order ...rs.
Apr 13 04:31:01 lsy sensors[11737]: No sensors found!
Apr 13 04:31:01 lsy sensors[11737]: Make sure you loaded all the kernel drivers you need.
Apr 13 04:31:01 lsy sensors[11737]: Try sensors-detect to find out which these are.
Apr 13 04:31:01 lsy systemd[1]: lm_sensors.service: main process exited, code=exite...URE
Apr 13 04:31:01 lsy systemd[1]: Failed to start Initialize hardware monitoring sensors.
Apr 13 04:31:01 lsy systemd[1]: Unit lm_sensors.service entered failed state.
Apr 13 04:31:01 lsy systemd[1]: lm_sensors.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

下午再研究

Logo

更多推荐