by CP
(Transferred from the wiki by Peter)

Introduction

So you have yourself a nice shiny install, and everything is working, but you don't know how well things are keeping cool. i2c is the way for you. i2c is basically a way of communicating with the sensors in your PC. This covers the install of i2c and lm_sensors for both the 2.4 kernel, and the 2.6 kernel. There are a few different ways to do this, but I am going to go through the most basic way, one which has always worked for me.

Installation

Kernel 2.4.9 or greater

For this method to work, you need to have a complete, compiled kernel tree that matches the version of the kernel you are running.
For the actual sensors software you need to go to http://www2.lm-sensors.nu/~lm78/download.html and download both the i2c package and the lm_sensors package. Once you have both of these downloaded you have to install i2c before lm_sensors. This is very simple thing to do. First extract the archive by running
Code:
tar -zxvf i2c-*.tar.gz
Then change to the newly created directory and run the following commands
Code:
su (enter your root password when it asks)
make all
make install
depmod -a
ldconfig
Once you have done that you can install lm_sensors.
Change to the directory where you downloaded the file and run
Code:
tar -zxvf ./lm_sensors*.tar.gz
Once again, change to the newly created directory and run these commands
Code:
su (enter your root password when it asks)
make all
make install
depmod -a
ldconfig
Once you have done this, you should have everything you need installed.
To set up the modules and various other things that need to be loaded run
Code:
sensors-detect
This will ask if you wish to probe your hardware for the correct sensors. You do. Once all the probing is complete, you will be given the option of creating lm_sensors.init, this is unneccesary, say no. You will also be given a small list that shows a series of commands. Put the list of commands at the end of one of your start-up scripts. How to do this is an entirely diffent PET. Once this is done, run the commands that you just put in the start-up script. Then run
Code:
sensors
You should see a whole lot of information regarding temperatures and voltages. If you don't, then obviously something went wrong in the install.
You can now use a program such as gkrellm to view these sensor outputs in real time.

Kernel 2.6

Go to http://www2.lm-sensors.nu/~lm78/download.html and download just the lm_sensors package.
Once you have it downloaded run
Code:
su (enter root password)
make user
make user_install
If all goes well here run
Code:
sensors-detect
Let it probe for hardware, and when it asks, choose to use the ISA bus if possible as it is faster. Once this is complete it will ask if you wish to create /etc/sysconfi/lm_sensors, say no.
You will have a list on your screen which shows commands showing modules to load. Now you need to recompile your kernel, including these modules. The module names may not be exactly the same, so note down the actual names as well as the module name before you compile. If you don't know how to do this, there is a PET for compiling your kernel, read that. If you are told you need the module i2c-isa then when you compile make sure you include support for the ISA bus under "Bus Options". Once you have done this, you need to get the sysfs filesystem working. For slackware it is as simple as creating the directory /sys and then adding the following line to your fstab
Code:
none /sys sysfs defaults 0 0
This should work for most distros. Once you have sysfs working, add the list of commands presented at the end of sensors-detect to a start-up script and reboot. If you don't want to reboot, then just run the commands presented, and make sure to mount /sys using
Code:
mount /sys
If all has gone as it should have running
Code:
sensors
should give you a list of temperatures, voltages and fan speeds, which you can monitor in real time using an application such as gkrellm.