IPMI sensors for Linux 2.6
Background The ipmisensors (formerly bmcsensors) driver is part of the lm_sensors project which aims to provide a unified approach to hardware monitoring under Linux. lm_sensors is composed of the kernel level drivers and the user level utilities. In kernel 2.6 the lm_sensors drivers have been merged into the mainstream kernel.

The bmcsensors driver was written by Mark Studebaker, and allows lm_sensors to read the many sensors present on an IPMI baseboard management controller (BMC). IPMI is a standard created by Intel, HP and others to standardize hardware monitoring amongst other common monitoring needs. An IPMI BMC can have any number of sensors of almost any number of different types. This project originally started out as a port of Mark's 2.4 driver to kernel 2.6.

Bmcsensors/i2c-ipmi (along with i2c-isa and others) were a hack to fit non-i2c hardware monitoring sensors into the lm-sensors i2c-centric view. However after a discussion with Jean Delvare when an attempt was made to merge bmcsensors into mainline, it was agreed that is was time to clean this problem up, and so a patch by Mark Hoffman introduced the new `hwmon' class of drivers to the kernel ridding the need for i2c-ipmi and prompting a re-write of the driver, and modifications of the linux driver core and IPMI subsystem.

As of August 2006 all the changes required have been mainlined (see below) and a working ipmisensors driver is available. Downloads Use the following table to determine which version of ipmi/bmcsensors to download:

<2.6.12bmcsensors-20050320
2.6.12bmcsensors-20050808
2.6.13-rc3bmcsensors-20050809
2.6.13 - 2.6.16need to patch kernel with ipmi sysfs support, and then apply ipmisensors patch.
>=2.6.17ipmisensors or ipmisensors experimental for the latest experimental patch generated from my git repository

If you encounter problems with a newer kernel than listed above, you may want to try the latest GIT version (GIT repository to be posted).

How to use ipmisensors (Kernel 2.6.17 and above) Make sure you have the kernel sources for your kernel installed, and install the latest version of lm-sensors lm_sensors utilities. Lastly download the latest ipmisensors patch.

Extract the kernel source somewhere and configure it (making sure CONFIG_IPMI_HANDLER, and CONFIG_IPMI_SI are set. Assuming the source is at /usr/src/linux, patch it with the ipmisensors patch:

cd /usr/src/linux
patch -p1 < /tmp/ipmisensors-2006XXXX-XXXX.diff
make oldconfig
IPMI Hardware Monitoring Support (SENSORS_IPMI) [N/m/y/?] (NEW) m

Continue to compile and install the new kernel as usual. Once in the new kernel make sure the required ipmi modules are loaded/compiled in (ipmi_msghandler, ipmi_si), and finally load and ipmisensors drivers.

You should now be able to use lm-sensors sensors utility to view the sensor readings, or your favourite lm-sensors compatible monitoring application (e.g. gkrellm). Please note that due to limitations with libsensors at the moment, sensors may not see more than 10 of each sensor type. To allow support for more, you must edit the maximum number of BMC sensors in lib/chips.c. A revised libsensors is expected to fix these limitations in the future.

If you encounter any problems, first make sure you have all the relevant modules (ipmi_msghandler, ipmi_si, ipmisensors) loaded or compiled into your kernel, and make sure you are using the driver best suited for your kernel version. If the problem persists please e-mail me (and optionally CC the lm-sensors mailing list) and be sure to include both your kernel log (the ipmisensors messages, i.e. dmesg|grep 'ipmisensors:') along with any output from the sensors and sensors-detect utililities.

How to use bmcsensors (Kernel 2.6.13-rc3 and below) Make sure you have the kernel sources for your kernel installed (or download and build a new kernel from the latest kernel source for which there is a patch), and the latest lm_sensors utilities (2.9 and above do not require a patch for bmcsensors). Lastly download the version of bmcsensors/i2c-ipmi best suited for your kernel version.

Extract the driver somewhere, and compile it, and as root install it:

tar -xjvf bmcsensors-<version>.tar.bz2
make
make install

After compiling and installing the driver successfully (without warnings) make sure the required ipmi modules are loaded/compiled in (ipmi_msghandler, ipmi_si), and finally load the i2c_ipmi and bmcsensors drivers.

You should now be able to use the sensors-detect script to identify any bmc present, and continue to load the i2c-ipmi and bmcsensors modules, and then use the sensors utility to view the sensor readings, or your favourite lm-sensors compatible monitoring application (e.g. gkrellm).

If you encounter any problems, first make sure you have all the relevant modules (ipmi_msghandler, ipmi_si, i2c_ipmi and bmcsensors) loaded or compiled into your kernel, and make sure you are using the driver best suited for your kernel version. If the problem persists please e-mail me (and optionally CC the lm-sensors mailing list) and be sure to include both your kernel log (the bmcsensors messages, i.e. dmesg|grep 'bmcsensors:') along with any output from the sensors and sensors-detect utililities.

Development of ipmisensors (or why the hell did this take so long?)
To even begin development of ipmisensors (and avoid the hacks of bmcsensors) several changes to the Linux 2.6 kernel to accomodate it, these were:

  • Dynamic sysfs callbacks (device_attribute) - kernel 2.6.13-rc1
  • Hwmon refactoring of hardware monitoring drivers (Thanks to Mark Hoffman, et. al)- kernel 2.6.13-rc4
  • Add sysfs/driver model to IPMI subsystem - kernel 2.6.17-rc1
  • Rewrite of bmcsensors/i2c-ipmi into ipmi-sensors - in progress see ipmisensors for the latest experimental patch generated from my git repository (if anyone knows how to host a git repository on sourceforge let me know). Please be warned that this patch may be broken at times, and should not be run on production machines at the moment.

Why? I own an HP x4000 workstation with an early IPMI 1.0 implementation using a Qlogic Zircon Lite BMC. I use kernel 2.6 extensively and was interested in using the driver to monitor my machine. Unwilling to stick with kernel 2.4 to do this I had a look at the source and decided I'd give porting the driver a shot. Open source at work I guess - "I had to scratch the itch".

I first wrote a patch in March 2004 and posted it to the lm_sensors mailing list, although that patch was soon dated by the change in sysfs naming conventions and also the lack of the associated lm_sensors utilities patch. I later revisited the in July 2004 by popular request and updated it to work on kernel 2.6.7 and lm_sensors 2.8.7. More recently I began work on ipmi-sensors, and the associated patches (see above), and in August 2005 the bmcsensors/i2c-ipmi driver was updated to work with 2.6.12, 2.6.13.

Developers Currently the sole developer is myself, Yani Ioannou, although anyone else who wishes to contribute to the project is welcome to submit patches to myself, and I will consider adding you to the list of developers on request.