Enabling Temperature Sensors in Linux

Write tutorials and howtos in here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Do not start a support topic here please. Before you post please read this

Enabling Temperature Sensors in Linux

Postby Blackwolf* on Sat Aug 29, 2009 6:53 am

Most computers these days come with a myriad of sensors to monitor the temperature of your computer. These sensors are generally located on the processor and the motherboard, and you might also have sensors on your video card. On top of that, all S.M.A.R.T-enabled hard drives have built-in temperature monitoring.

The temperature of your computer is a vital thing to keep track of - heat and computers don't mix very well. Unfortunately, Ubuntu doesn't setup your computer's sensors automatically; but you can follow these steps to enable the temperature sensors in your computer in Ubuntu, or any other version of Linux. While sensor-monitoring is somewhat hardware dependant, this guide will work for most users. It involves heavy use of the command-line, but don't worry - I will walk you through it step-by-step.


1. Installing the sensor libraries
First thing's first - you need to install the libraries that allow Linux to read your sensors. To do this, install the lm-sensors library, by running the command:

sudo apt-get install lm-sensors
This will install the libraries for your motherboard's sensors. For your hard-disk sensors, you'll want to install hddtemp:

sudo apt-get install hddtemp
In Ubuntu, the install will ask you several questions. First it will ask if it should run SUID root, select "yes." It will then ask you for an interval for logging the temperature to a file; since we are going to have an applet display our system temperatures for us, this isn't necessary, so most users will be fine leaving the default of '0' and pressing enter; if you wish to log this data, however, I'd recommend a value between 2 and 10 seconds. Next, it will ask if it should run as a deamon; select yes, and leave the default values for hostname and port. Finally, it will ask if you wish for it to run on startup - select "yes."


2. Running sensors-detect
Now that your sensor libraries are installed, you need to detect your sensors! Run the command:

sudo sensors-detect
Which will probe your system for sensors. Answer "YES" to all questions! Don't just hit enter, type "YES", because at the end there will be a question for which the default answer is "no", and we'll want to answer in the affirmative.

The sensors-detect program will scan yur system, and then give you a summary, stating which sensors it has found. It will then say: I will now generate the commands needed to load the required modules. After you hit ENTER to continue, it will ask, Do you want to add these lines to /etc/modules automatically? (yes/NO) This is the question we want to make sure we answer YES to.


3. Loading the modules
Since we answered YES to the previous question, our sensor modules will be loaded by default the next time we start up. But since we don't want to have to reboot, we're going to use the information we got from the sensors-detect script to load the modules ourselves, this time only. Right above the last question will appear a list of modules that you should load, in the form of:

#----cut here----
# Chip drivers
smsc47m1
#----cut here----


You may have more, or different, items listed - that's fine! What we want to do now, to load these modules, is use the modprobe command, as follows:

sudo modprobe [module name]
So, in my case, I would type:

sudo modprobe smsc47m1
If all goes well, you should be returned to the command-line, without any output.


4. Monitoring the sensors!
Wow, that was a lot of work! Now, let's see the rewards. On the command line, you can simply run the

sensors
command; this will output the information from your motherboard's sensors.

However, we'd rather have a graphical interface for checking up on our hardware, so let's install an applet for our Gnome desktop to keep an eye on our system's temperature. Run the command:

sudo apt-get install sensors-applet
to install the applet. Now, add the applet by right-clicking on your desktop panel, selecting "Add to Panel," and you will now see a "Hardware Sensors Monitor" applet in the System & Hardware section. Click and drag this to your panel to add it.

The applet will now say that you haven't enabled any sensors; right click on the applet and open its preferences. The first screen is for general settings:
Soprano E66 Custom>Intel Core2Duo E6600 LGA775
Corsair TWIN 2 X 2048-5400C4 X MS2 2 X 1GB
MSI P965 PLATINUM ATX
Samsung HD401LJ 400GB 16MB SATA11
XPV GeFORCE 8600GTS 256MB GDDR3 PCI-E HD
Image
User avatar
Blackwolf*
Level 1
Level 1
 
Posts: 9
Joined: Sat Aug 29, 2009 6:15 am
Location: Climbing through your back window

Linux Mint is funded by ads and donations.
 

Re: Enabling Temperature Sensors in Linux

Postby Muzer on Sat Aug 29, 2009 7:45 am

On KDE, once you have sensors installed and set up, you can add the "System Monitor - Temperature" plasmoid to your desktop to keep an eye on the temperature. If you go the preferences, you can also define names for each of the sensors - use the output of the sensors command to help you.


System Monitor - Hard Disk has build-in SMART temperature support, though it might only work once hddtemp is installed.




Finally, if you own an NVIDIA graphics card, you will find this very helpful:
http://kde-look.org/content/show.php/Nv ... tent=87195

(it would be nice if that were implemented into lm-sensors, but you can't win all the time)








PS: Did you miss a bit off the end of the tutorial? ;)
Muzer
Level 4
Level 4
 
Posts: 221
Joined: Thu Aug 27, 2009 2:09 pm

Re: Enabling Temperature Sensors in Linux

Postby nono on Sun Oct 11, 2009 8:49 pm

Thank You BlackWolf*
Reminder: If your problem is already solved or your topic is fullfilled, kindly put [SOLVED] on your topic title.
User avatar
nono
Level 3
Level 3
 
Posts: 160
Joined: Sat Jun 28, 2008 11:50 pm
Location: Philippines

Re: Enabling Temperature Sensors in Linux

Postby vk1rj on Tue Dec 15, 2009 7:12 pm

I am using LinuxMint8 on this ASUS (A7N8X) motherboard. I want to measure the temperatures inside this machine ... but am having trouble getting 'lm-sensors' to work. Sometimes the software manager tells me that it is NOT available, and at others I get the message that it is installed???

When I try to run the program as per your suggestions ... I get zero result. Has there been a change to the operation of lm-sensors under LinuxMint8?? Are there alternatives??

riccardo
vk1rj
Level 1
Level 1
 
Posts: 10
Joined: Mon Mar 16, 2009 8:57 pm


Return to Tutorials / Howtos

Who is online

Users browsing this forum: No registered users and 11 guests