lm_sensors Configuration

Introduction

lm_sensors (Linux-monitoring sensors), a free open source software-tool for Linux, provides tools and drivers for monitoring temperatures, voltage, and fans. It can also be used to monitor chassis intrusion detection. See http://en.wikipedia.org/wiki/Lm-sensors for introductory information.

Most PC's built since late 1997 now come with a hardware health monitoring chip. This chip may be accessed via the ISA I/O ports or the SMBus, depending on the motherboard. Sometimes is the monitoring block embedded into super I/O chip, usually made by Winbond, ITE or SMSC.

These chips sense the temperatures, voltages and fans and provide this information to the operating system via a chip driver. Sometimes the chips can also provide automatic fan control, which regulate fan speed depending on the temperature.

The primary mission of the strong>lm_sensors project was to provide the most complete hardware health monitoring support for Linux, in the form of kernel drivers and a user-space library. The projects seeks to produce well organized, efficient, safe, flexible, and tested code free of charge to all Linux users. The project attempts to support as many related devices as possible (when documentation is available), especially those which are commonly included on PC mainboards.

The drivers provide the base software layer for utilities to acquire data on the environmental conditions of the hardware. A user-space access library and a sample text-oriented utility built on top of said library are used to display sensor data. While this simple utility is sufficient for many users, others desire more elaborate user interfaces. We leave the development of these GUI-oriented utilities to others.

The software is flexible and can be used in a wide range of scenarios:

The following guidance might be useful in helping to configure lm_sensors on a Linux server.

My lm_sensors Configuration


Essentially the standard installation procedure as described in the lm_sensors link below was followed. However some difficulties were encountered and these are also outlined below.


Investigations


Check what, if any, monitoring sensors are available:

[user@host ~]$ sensors -v
sensors version 2.8.7 with libsensors version 2.8.7
[user@host ~]$
 
[user@host ~]$ sensors -A
eeprom-i2c-0-51
Memory type:            SDR SDRAM DIMM
Memory size (MB):       256

eeprom-i2c-0-50
Memory type:            SDR SDRAM DIMM
Memory size (MB):       256

[user@host ~]$

[user@host ~]$ sensors -f
eeprom-i2c-0-51
Adapter: SMBus I801 adapter at dcd0
Memory type:            SDR SDRAM DIMM
Memory size (MB):       256

eeprom-i2c-0-50
Adapter: SMBus I801 adapter at dcd0
Memory type:            SDR SDRAM DIMM
Memory size (MB):       256

[user@host ~]$

Other checks:

[root@host ~]# sensors-detect

This program will help you determine which I2C/SMBus modules you need to
load to use lm_sensors most effectively. You need to have i2c and
lm_sensors installed before running this program.
Also, you need to be `root', or at least have access to the /dev/i2c-*
files, for most things.
If you have patched your kernel and have some drivers built in, you can
safely answer NO if asked to load some modules. In this case, things may
seem a bit confusing, but they will still work.

It is generally safe and recommended to accept the default answers to all
questions, unless you know what you're doing.

 We can start with probing for (PCI) I2C or SMBus adapters.
 You do not need any special privileges for this.
 Do you want to probe now? (YES/no):
Probing for PCI bus adapters...
Use driver `i2c-i801' for device 00:1f.3: Intel 82801BA ICH2
Use driver `i2c-i810' for device 00:02.0: Intel 82815 GMCH
Probe succesfully concluded. 
We will now try to load each adapter module in turn.
Module `i2c-i801' already loaded.
Load `i2c-i810' (say NO if built into your kernel)? (YES/no):
Module loaded succesfully.
If you have undetectable or unsupported adapters, you can have them
scanned by manually loading the modules before running this script.

 To continue, we need module `i2c-dev' to be loaded.
 If it is built-in into your kernel, you can safely skip this.
i2c-dev is already loaded.
…
…
 Sorry, no chips were detected.
 Either your sensors are not supported, or they are
 connected to an I2C bus adapter that we do not support.
 See doc/FAQ, doc/lm_sensors-FAQ.html, or
 http://www2.lm-sensors.nu/~lm78/cvs/lm_sensors2/doc/lm_sensors-FAQ.html
 (FAQ #4.24.3) for further information.
 If you find out what chips are on your board, see
 http://secure.netroedge.com/~lm78/newdrivers.html for driver status.
[root@host ~]#

At tail end of dmesg output found:

[root@host ~]# dmesg | tee dmesg-output-20091009.txt
..
…
i810_smbus 0000:00:02.0: i810/i815 i2c device found.

Further investigations ...

[root@host mcsysinfo]# i2cdetect -l
i2c-2   unknown         I810/I815 DDC Adapter                   Algorithm unavailable
i2c-1   unknown         I810/I815 I2C Adapter                   Algorithm unavailable
i2c-0   unknown         SMBus I801 adapter at dcd0              Algorithm unavailable

[root@host mcsysinfo]# i2cdetect 0
  WARNING! This program can confuse your I2C bus, cause data loss and worse!
  I will probe file /dev/i2c-0.
  I will probe address range 0x03-0x77.
  You have five seconds to reconsider and press CTRL-C!

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          XX XX XX XX XX XX XX XX XX XX XX XX XX
10: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
20: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
30: 30 XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
40: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
50: UU UU XX XX XX XX XX XX XX XX XX XX XX XX XX XX
60: XX XX XX XX XX XX XX XX XX 69 XX XX XX XX XX XX
70: XX XX XX XX XX XX XX XX
[root@host mcsysinfo]#
[root@host mcsysinfo]#

99 is the clock.
50 and 51 are eeprom device addresses

So tried to update the current installaed version using yum:

[root@host lm_sensors]# yum update lm_sensors
…
…
No updates (but the current version of lm_sensors is lm-sensors 3.1.0) - this is the latest release of the stable branch, for Linux 2.6.5+.

Whereas v2.8.x is currently installed.

As root carry out the following to manually update the version installed on the system:

Downloaded as follows

[root@host lm_sensors]# wget http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-3.1.0.tar.bz2

Unpack
[root@host lm_sensors]# tar xjvf lm_sensors-3.1.0.tar.bz2

Build
[root@host lm_sensors]# make all

[root@host lm_sensors]# 

[root@host lm_sensors-3.1.0]# make install
mkdir -p /usr/local/lib /usr/local/include/sensors /usr/local/man/man3 /usr/local/man/man5
******************************************************************************
Warning: This is the first installation of the libsensors.so.4*
         library files in /usr/local/lib!
         You must update the library cache or the userspace tools may fail
         or have unpredictable results!
         Run the following command: /sbin/ldconfig
******************************************************************************
install -m 644 lib/libsensors.a /usr/local/lib
install -m 755 lib/libsensors.so.4.1.0 /usr/local/lib
ln -sf libsensors.so.4.1.0 /usr/local/lib/libsensors.so.4
ln -sf libsensors.so.4 /usr/local/lib/libsensors.so
******************************************************************************
Warning: Library directory /usr/local/lib is not in /etc/ld.so.conf!
         Add it and run /sbin/ldconfig for the userspace tools to work.
******************************************************************************
install -m 644 lib/error.h lib/sensors.h /usr/local/include/sensors
install -m 644 lib/libsensors.3 /usr/local/man/man3
install -m 644 lib/sensors.conf.5 /usr/local/man/man5
mkdir -p /usr/local/sbin /usr/local/man/man8
install -m 755 prog/detect/sensors-detect /usr/local/sbin
install -m 644 prog/detect/sensors-detect.8 /usr/local/man/man8
mkdir -p /usr/local/sbin /usr/local/man/man8
install -m 755 prog/pwm/fancontrol prog/pwm/pwmconfig /usr/local/sbin
install -m 644 prog/pwm/fancontrol.8 prog/pwm/pwmconfig.8 /usr/local/man/man8
mkdir -p /usr/local/bin /usr/local/man/man1
install -m 755 prog/sensors/sensors /usr/local/bin
install -m 644 prog/sensors/sensors.1 /usr/local/man/man1
mkdir -p /etc
mkdir -p /etc/sensors.d
if [ ! -e /etc/sensors3.conf ] ; then \
  install -m 644 etc/sensors.conf.default /etc/sensors3.conf; \
fi
mkdir -p /usr/local/bin
install -m 755 etc/sensors-conf-convert /usr/local/bin
mkdir -p /usr/local/sbin /usr/local/man/man8
install -m 755 prog/dump/isadump prog/dump/isaset /usr/local/sbin
install -m 644 prog/dump/isadump.8 prog/dump/isaset.8 /usr/local/man/man8
*** Important notes:
***  * The libsensors configuration file (/etc/sensors3.conf) is never
***    overwritten by our installation process, so that you won't lose
***    your personal settings in that file. You still can get our latest
***    default config file in etc/sensors.conf.default and manually copy
***    it to /etc/sensors3.conf if you want. You will then want to
***    edit it to fit your needs again.
***  * The format of /etc/sensors3.conf changed with lm-sensors 3.0.0.
***    If you have a custom configuration file using the old format, you
***    can convert it using the sensors-conf-convert script. Otherwise just
***    overwrite your old configuration file with the new default one.
***  * As off lm-sensors 3.1.0, the default configuration file only
***    contains statements which do not depend on how chips are wired.
***    If you miss parts of the bigger configuration file that used to be
***    the default, copy the relevant parts from etc/sensors.conf.eg to
***    /etc/sensors3.conf.
[root@host lm_sensors-3.1.0]#

Edit the /etc/sensors3.conf file:

[root@host lm_sensors-3.1.0]# vi /etc/sensors3.conf

Now sensor detection returns:

[root@host etc]# sensors-detect
# sensors-detect revision 5666 (2009-02-26 17:15:04 +0100)
# DMI data unavailable, please consider installing dmidecode 2.7
# or later for better results.

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 K10 thermal sensors...                                  No
Intel Core family thermal sensor...                         No
Intel AMB FB-DIMM thermal sensor...                         No
VIA C7 thermal and voltage sensors...                       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):
Probing for Super-I/O at 0x2e/0x2f
Trying family `National Semiconductor'...                   Yes
Found `Nat. Semi. PC87364 Super IO Fan Sensors'
    (but not activated)
Probing for Super-I/O at 0x4e/0x4f
Trying family `National Semiconductor'...                   No
Trying family `SMSC'...                                     No
Trying family `VIA/Winbond/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 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-i801' for device 0000:00:1f.3: Intel 82801BA ICH2

Next adapter: SMBus I801 adapter at dcd0 (i2c-0)
Do you want to scan it? (YES/no/selectively):
Client at address 0x50 can not be probed - unload all client drivers first!
Client at address 0x51 can not be probed - unload all client drivers first!

Next adapter: I810/I815 I2C Adapter (i2c-1)
Do you want to scan it? (YES/no/selectively):

Next adapter: I810/I815 DDC Adapter (i2c-2)
Do you want to scan it? (YES/no/selectively):

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
http://www.lm-sensors.org/wiki/Devices for driver status.
[root@host etc]#

Conclusion


The conclusion is that it does not appear that this CentOS Linux system is currently able to support lm_sensors and generate any sensible outputs. This is probably because it is based on a Dell Optiplex GX150 workstations/server) - and indeed this would seem to be confirmed by the Hardware That Doesn't Work with Linux URL shown below.


General Links

The following general links are useful references when setting up lm_sensors:


URLSummary/Description
http://www.lm-sensors.org/ lm_sensors - Linux hardware monitoring
http://wiki.linuxquestions.org/wiki/Lm-sensors Lm-sensors-LQwiki
http://leenooks.com/page/show/Hardware Monitoring Hardware That Doesn't Work with Linux