LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 11-10-2007, 05:28 PM   #1
tduglas
LQ Newbie
 
Registered: Apr 2007
Location: Moscow
Distribution: Debian
Posts: 13

Rep: Reputation: 0
Question How to get CPU temperature in linux


Are there any libraries which allow me to get cpu temperature by simple library call?

Can i programmatically measure the heat dissipatiotion by the cpu?
 
Old 11-10-2007, 05:32 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 162Reputation: 162
Yes to your first question - have a look at http://www.lm-sensors.org/ (although Debian probably provides packages). I'm not sure about the second question...
 
Old 11-10-2007, 08:10 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,005
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
If your machine uses ACPI...

cat /proc/acpi/thermal_zone/THM0/temperature


Cheers,
Tink
 
1 members found this post helpful.
Old 11-11-2007, 04:17 PM   #4
tduglas
LQ Newbie
 
Registered: Apr 2007
Location: Moscow
Distribution: Debian
Posts: 13

Original Poster
Rep: Reputation: 0
Post

Quote:
Originally Posted by Tinkster View Post
If your machine uses ACPI...

cat /proc/acpi/thermal_zone/THM0/temperature


Cheers,
Tink
i can only move to /proc/acpi/thermal_zone/.
Linux laptop 2.6.18-4-686 #1 SMP Mon Mar 26 17:17:36 UTC 2007 i686 GNU/Linux
 
Old 11-12-2007, 04:11 AM   #5
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,314

Rep: Reputation: 175Reputation: 175
take the cover off and put your finger on it
 
Old 11-13-2007, 05:28 PM   #6
kromberg
Member
 
Registered: Feb 2007
Location: Colorado
Distribution: FC6, FC7 x86_64
Posts: 218

Rep: Reputation: 30
Quote:
Originally Posted by bigearsbilly View Post
take the cover off and put your finger on it
Writting the man page for that would be way too complicated

Keith
 
Old 02-03-2010, 04:04 AM   #7
Shm00nix
LQ Newbie
 
Registered: Jul 2009
Location: Lower S10b0v1a
Distribution: Debian
Posts: 6

Rep: Reputation: 0
Slight ACPI path change

Quote:
Originally Posted by Tinkster View Post
If your machine uses ACPI...

cat /proc/acpi/thermal_zone/THM0/temperature

Cheers,
Tink
On my 2010 Debian Lenny system, the path is:

proc/acpi/thermal_zone/THRM/temperature
 
Old 02-03-2010, 09:46 AM   #8
wje_lq
Member
 
Registered: Sep 2007
Location: Mariposa
Distribution: Debian lenny, Slackware 12
Posts: 809

Rep: Reputation: 178Reputation: 178
Quote:
Originally Posted by bigearsbilly View Post
take the cover off and put your finger on it
;)
A clear case of the act of measuring affecting the result, unless your finger has a specific heat of 0.
 
Old 02-13-2010, 01:49 PM   #9
federico.a
LQ Newbie
 
Registered: Feb 2010
Posts: 1

Rep: Reputation: 0
In Ubuntu try...

Code:
acpi -t
 
Old 05-13-2010, 04:54 AM   #10
icarstudio
LQ Newbie
 
Registered: May 2010
Location: Odessa, Ukraine
Distribution: openSuSe 11.1
Posts: 1

Rep: Reputation: 0
Thx! Also i'll tell U, that on my OpenSusu 11.1 works both:
cat /proc/acpi/thermal_zone/THRM/temperature
acpi -t
 
Old 08-09-2010, 03:36 AM   #11
raviteja_s
Member
 
Registered: Jun 2010
Location: India
Distribution: Redhat
Posts: 68

Rep: Reputation: 1
Wink Take the Thermometer and check it...

it will work..........
 
1 members found this post helpful.
Old 08-09-2010, 08:48 AM   #12
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714Reputation: 714
Quote:
Originally Posted by raviteja_s View Post
it will work..........
Is that a joke or spam? Do you realize this thread is a few months old?
 
Old 04-28-2011, 01:51 PM   #13
aitorpazos
LQ Newbie
 
Registered: Mar 2010
Posts: 1

Rep: Reputation: 0
Moving towards /sys

As /proc is being deprecated you can check your system's temp with acpi -t as it's been said or with "cat /sys/bus/acpi/devices/LNXTHERM\:00/thermal_zone/temp". Result is given in mēC (The thermometer you might be interested in might not be in that exact path).
 
Old 04-28-2011, 02:08 PM   #14
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,653
Blog Entries: 2

Rep: Reputation: 4097Reputation: 4097Reputation: 4097Reputation: 4097Reputation: 4097Reputation: 4097Reputation: 4097Reputation: 4097Reputation: 4097Reputation: 4097Reputation: 4097
Quote:
Originally Posted by tduglas View Post
Linux laptop 2.6.18-4-686 #1 SMP Mon Mar 26 17:17:36 UTC 2007 i686 GNU/Linux
According to your kernel version you are still using Debian Etch. Etch is not supported anymore (no security updates) since February 2010. I would strongly recommend to upgrade at least to Lenny, better to Squeeze.
 
Old 04-28-2011, 02:39 PM   #15
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,604

Rep: Reputation: 446Reputation: 446Reputation: 446Reputation: 446Reputation: 446
Quote:
Originally Posted by TobiSGD View Post
According to your kernel version you are still using Debian Etch. Etch is not supported anymore (no security updates) since February 2010. I would strongly recommend to upgrade at least to Lenny, better to Squeeze.
Hi,

while this is good advice I just want to point out that this is a resurrected thread that was started in 2007 ...
 
1 members found this post helpful.
  


Reply

Tags
acpi, cpu, debian, proc


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cpu temperature alaios Linux - Hardware 4 09-21-2004 05:30 PM
CPU Temperature in LInux? fedivh Linux - Hardware 9 02-20-2004 04:51 PM
how to get cpu temperature taoweijia Linux - Software 3 02-13-2004 07:04 PM
CPU Temperature Cubiq Programming 3 04-06-2002 12:04 PM


All times are GMT -5. The time now is 12:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration