Check Your Computer Temperature


Written by Pavs on December 21st, 2007

If you are lke me and often stress test your laptop (all my tests pictures you see are done on this laptop) like the post before shows chances are your machine gets hot alot. While todays machines are build to last long and endure more stress than ever before, it would be nice to to know at any given time whats the temperature of your machine. Some machine go hotter even without running all sorts of stress tests, but because of the siple fact that either your cooling system is broken or faulty. In linux there are nice packages you can download that will constantly show you your cpu temperature. But we don’t like that we want to see it on the terminal. :)

Just do cat /proc/acpi/thermal_zone/THRM/temperature and you will get your numbers (the path is not standard, so check your own proc temperature file).

2007-12-21-014613_1280x800_scrot

This guy (http://crake.servu.org/~asmo/xhtml/Fujitsu-LifeBook-E6540.html) made a nice script that he puts in a cronjob. It runs every five minutes and checks for the temperature. If the temperature is lower than 40C it will turn the fan off, it will turn the fan on when the temperature reaches 50C.

#/bin/bash

# check temperature
temp1=`cat /proc/acpi/thermal_zone/TZ1/temperature | awk {’print $2′}`
temp2=`cat /proc/acpi/thermal_zone/TZ2/temperature | awk {’print $2′}`

echo “Current temperature TZ1: $temp1″
echo “Current temperature TZ2: $temp2″

# turn fan on when too warm
if [[ "$temp1" -ge "50" || "temp2" -ge "50" ]];
then
echo -n 0 >/proc/acpi/fan/FAN/state
fi

# turn fan off when not too warm
if [[ "$temp1" -le "40" || "temp2" -le "40" ]];
then
echo -n 3 >/proc/acpi/fan/FAN/state
fi



One Response to “Check Your Computer Temperature



Leave a Reply

Note: Any comments are permitted only because the site owner is letting you post, and any comments will be removed for any reason at the absolute discretion of the site owner.

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word