Wednesday, November 23, 2011

Keeping it cool... tracking CPU temperatures on Debian GNU/Linux with a 3.1 kernel

My laptop is getting old (almost 12 months now), and is starting to see the first symptoms of age. Probably just dust piling up, but I have been experiencing CPU overheating. A week or too I found a nice one-liner to keep an eye on the CPU temperature, but a kernel upgrade to 3.1 broke that. Here is a script that works on my Linux laptop:

( cd /sys/class/thermal && while :; do line="`date`:`cat */temp | cut -c1-2 | awk '{ printf(\" %03d\", $1) }'`";   echo "$line";   sleep 5; done ) | tee LOG