Thursday, 1 October 2009

Getting sense out of the sensors applet

There are times when I drive my laptop CPU really hard, for example compressing Gigs of data or running QEMU, and it would be useful to see how hot my processor is actually getting. This is where sensors-applet is useful - it has the ability to show the core temperature of the CPU and HDD if one has the appropriate hardware sensors and drivers installed. However, getting it configured requires a little bit of hand-holding to get it working.

Firstly, install sensors-applet using:

sudo apt-get install sensors-applet

..this will also install the lm-sensors tools.

Next, one needs to probe the H/W to find the appropriate drivers required to be able to sense CPU and HDD temperatures. To do this use:

sudo sensors-detect

This will ask you if you want to probe and scan various I2C, PCI and SMBus adaptors, so answer the probing questions with respect to the hardware you have in your machine. On my machine I answered "YES" to every question, your mileage may vary.

At the end of the probing, sensors-detect will print out some lines that you need to add to /etc/modules. Using sudo, edit /etc/modules and add these lines. Then reboot your machine.

Once you are logged in again, right click on the top Gnome panel and select "Add to Panel.." and scroll down and select the "Hardware Sensors Monitor". Once it's added to the panel, right click on it and select "Preferences". On the Sensors Applet Preferences panel, select the "Sensors" tab and then select the appropriate CPU and HDD devices to monitor.


Once this is done, you will hopefully be able to see your CPU and HDD temperatures rise and fall as you work on your machine:


From the command line one can also get the current sensor data using the sensors command, e.g.:

$ sensors
coretemp-isa-0000
Adapter: ISA adapter
Core 0: +58.0°C (high = +85.0°C, crit = +85.0°C)

coretemp-isa-0001
Adapter: ISA adapter
Core 1: +57.0°C (high = +85.0°C, crit = +85.0°C)

Hopefully I won't see my CPU get to 85 degrees C, but now at least I can keep my eye on how hot it's getting :-)

1 comment:

  1. It would be wonderful if you had the time to help update the lm-sensors package.

    https://bugs.launchpad.net/bugs/336418

    I looked at the ubuntu patches, but I haven't tried applying them to the latest source.

    Best
    Anders

    ReplyDelete