AMP AMP

How To Install lm_sensors on CentOS 7

How To Install lm_sensors on a CentOS 7

lm_sensor is a hardware health monitoring tool that monitors the health of the target system in CentOS. To install lm-sensors on a CentOS, RHEL, Scientific and older version of Fedora Linux (fedora v21 or older) is explained below.

To install lm_sensor

To install lm_sensor, type the following command.

[root@linuxhelp1 ~]# yum install lm_sensors
Loaded plugins: fastestmirror, langpacks
base                                                                       | 3.6 kB  00:00:00    
extras                                                                     | 3.4 kB  00:00:00    
updates                                                                    | 3.4 kB  00:00:00    
updates/7/x86_64/primary_db                                                | 1.2 MB  00:00:14    
Determining fastest mirrors
 * base: mirror.fibergrid.in
 * extras: mirror.fibergrid.in
 * updates: mirror.fibergrid.in
Resolving Dependencies
-->  Running transaction check
--->  Package lm_sensors.x86_64 0:3.4.0-4.20160601gitf9185e5.el7 will be installed
-->  Processing Dependency: lm_sensors-libs = 3.4.0-4.20160601gitf9185e5.el7 for package: lm_sensors-3.4.0-4.20160601gitf9185e5.el7.x86_64
-->  Running transaction check
--->  Package lm_sensors-libs.x86_64 0:3.3.4-10.el7 will be updated
--->  Package lm_sensors-libs.x86_64 0:3.4.0-4.20160601gitf9185e5.el7 will be an update
-->  Finished Dependency Resolution
.
.
Total size: 181 k
Total download size: 140 k
Is this ok [y/d/N]: y
Downloading packages:
.
.
Installed:
  lm_sensors.x86_64 0:3.4.0-4.20160601gitf9185e5.el7                                             
Dependency Updated:
  lm_sensors-libs.x86_64 0:3.4.0-4.20160601gitf9185e5.el7                                        
Complete!

How to use lm_sensors on CentOS

Once lm_sensors is installed you need to type:

[root@linuxhelp1 ~]# sensors-detect
# sensors-detect revision 3.4.0-4 (2016-06-01)
# System: VMware, Inc. VMware Virtual Platform [None]
# Board: Intel Corporation 440BX Desktop Reference Platform
# Kernel: 3.10.0-123.el7.x86_64 x86_64
# Processor: Intel(R) Core(TM) i5-2310 CPU @ 2.90GHz (6/42/7)
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):
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):
Do you want to scan for Super I/O sensors? (YES/no):
Probing for Super-I/O at 0x2e/0x2f
Trying family `National Semiconductor/ITE' ...               Yes
Found unknown chip with ID 0x0f00
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):
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):
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):
Using driver `i2c-piix4'  for device 0000:00:07.3: Intel 82371AB PIIX4 ACPI
Module i2c-dev loaded successfully.
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):
Unloading i2c-dev... OK

Hit ENTER key for everything the installation procedure suggests. At the end it will ask you whether to add what it finds to /etc/modules. If you are happy with the output i.e. findings type “ yes” .

To see the values for the hardware sensors detected on your motherboard / server, type:

[root@linuxhelp1 ~]# sensors

OUTPUT:

coretemp-isa-0000
Adapter: ISA adapter
Physical id 0:      N/A  (high = +100.0° C, crit = +100.0° C)
Core 0:             N/A  (high = +100.0° C, crit = +100.0° C)
Core 1:             N/A  (high = +100.0° C, crit = +100.0° C)

coretemp-isa-0001
Adapter: ISA adapter
Physical id 1:      N/A  (high = +100.0° C, crit = +100.0° C)
Core 0:             N/A  (high = +100.0° C, crit = +100.0° C)
Core 1:             N/A  (high = +100.0° C, crit = +100.0° C)

Or use the following command

[root@linuxhelp1 ~]# sensors | less

OUTPUT:

coretemp-isa-0000
Adapter: ISA adapter
Physical id 0:      N/A  (high = +100.0° C, crit = +100.0° C)
Core 0:             N/A  (high = +100.0° C, crit = +100.0° C)
Core 1:             N/A  (high = +100.0° C, crit = +100.0° C)

coretemp-isa-0001
Adapter: ISA adapter
Physical id 1:      N/A  (high = +100.0° C, crit = +100.0° C)
Core 0:             N/A  (high = +100.0° C, crit = +100.0° C)
Core 1:             N/A  (high = +100.0° C, crit = +100.0° C) 

To know about the fan, CPU and temp of the system, type the following command.

[root@linuxhelp1 ~]# sensors | egrep -i --color ' fan|cpu|temp' 

OUTPUT:

coretemp-isa-0000
coretemp-isa-0001
Tag : lm_sensor
FAQ
Q
Do I need the configuration file /etc/sensors.conf in lm_sensors?
A
Yes, for any applications that use libsensors, including the sensors application included in our package. It tells libsensors how to translate the values the chip measures to real-world values. This is especially important for voltage inputs. The default configuration file should usually do the trick. It is automatically installed as /etc/sensors.conf, but it will not overwrite any existing file with that name.
Q
How often are the sensor values updated in lm_sensors?
A
The LM78, and most other sensor chips like it, reads its sensors one by one. A complete scanning sweep will take about 1.5 seconds. The LM78 stops readings sensors if you try to access it, so if you access it very often (by reading sensor values; writing new limits is safe) it will not find the time to update its sensor values at all.
Q
How are alarms triggered in lm_sensors?
A
It is possible to monitor each sensor and have an alarm go off if it crosses some pre-determined limits. There are two sorts of interrupts which can be generated by sensor chips if this happens (it depends a bit on the actual chip if both are supported; the LM80, for example, has only IRQ interrupts): IRQ interrupts and SMI interrupts. IRQ stands for Interrupt Request and are the interrupt lines you can find in /proc/interrupts.
Q
How do I know which chips I own in lm_sensors?
A
We have an excellent program that scans all your hardware. It is called sensors-detect and is installed in /usr/local/sbin by make install. Just execute this script, and it will tell you.



Chip detection in the drivers is fairly good. That means that it is usually harmless to insert more chip drivers than you need. However, this can still lead to problems, so we do not recommend it.
Q
Which modules should I insert in lm_sensors?
A
sensors-detect will tell you You need one module for each sensor chip and bus adapter you own;



modprobe i2c-isa

modprobe i2c-piix4

modprobe lm78