Playing with hardware sensors in linux

Thursday, March 23. 2006, 15:11
Yesterday I played around a bit with what hardware sensors can do and how to access them in linux.

hddtemp

The first, and quite trivial tool I tried was hddtemp. You don't need to do anything further, just install it and run
hddtemp /dev/hda
(Assuming your harddisk is hda, which is usually the case)

It supports a bunch of harddisks by default and if it doesn't know your HD, it tries to access it with some default-values. Extending the hd-database seems to be trivial, I already sent a patch for my HD. Output looks like this:
/dev/hda: SAMSUNG MP0804H: 46°C

lm_sensors

lm_sensors is a bunch of drivers and tools to use hardware-sensors on motherboards. As you probably have no idea what chips your motherboard has, lm_sensors brings a tool called sensors-detect to help you. The way to go is just enabling everything (except debugging, which you usually don't need) in the kernel-sections i2c and hardware monitoring as module and let sensors-detect to the work.
Basically, pressing return all the time should be okay. At the end, it'll tell you which kernel-modules are useful for your system.

After that, running sensors shows something like this:
max6657-i2c-0-4c
Adapter: SMBus I801 adapter at 1100

M/B Temp: +40°C (low = -65°C, high = +127°C)
CPU Temp: +36.6°C (low = +35.1°C, high = +72.2°C)
M/B Crit: +110°C (hyst = +100°C)
CPU Crit: +110°C (hyst = +100°C)


Well, not that useful, but interesting to know that I have at least 3 temperature-sensors in my laptop.

Update: As noted by Joshua Jackson in the comments, with smartctl /dev/hda (from smartmontools) you get the temperature and much more information about your HD.

Trackbacks

No Trackbacks

Comments
Display comments as (Linear | Threaded)

just curious about why you used hddtemp instead of smartmontools smartctl, true it will give you a lot more then just the temperature, but might be interesting.
#1 Joshua Jackson (Link) on 2006-03-23 20:41 (Reply)
It's not possible to use them with S-ATA discs.
#2 Lars Strojny (Link) on 2006-03-28 03:09 (Reply)
You need to tune /etc/sensors.conf to match the exact hardware configuration on your mainboard. Every manufacturer uses different resistor values, so just knowing the kind of chips used doesn't help much.
The sensors.conf shipped with lm_sensors contains examples for many mainboards, but I experienced problems with them, maybe because the manufacturer changed the values on the newer revisions of the board.
So good luck and take the output with a grain of salt.
#3 Anonymous on 2006-04-03 00:14 (Reply)
With this summer's heat way, and no AC in my house, I was worried my HD would melt down. Hddtemp was all I needed and I'm pretty happy with it. I was super easy to make an RRD out of it too.

http://caldergroup.com/linux/rrd-create-gauge-rra.html
#4 Eric Passmore (Link) on 2006-08-18 19:18 (Reply)

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.