LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 04: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, 04:32 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
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, 07:10 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

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

cat /proc/acpi/thermal_zone/THM0/temperature


Cheers,
Tink
 
1 members found this post helpful.
Old 11-11-2007, 03: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, 03:11 AM   #5
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
take the cover off and put your finger on it
 
Old 11-13-2007, 04: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, 03:04 AM   #7
Shm00nix
LQ Newbie
 
Registered: Jul 2009
Location: Lower S10b0v1a
Distribution: Debian
Posts: 18
Blog Entries: 1

Rep: Reputation: 1
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, 08:46 AM   #8
wje_lq
Member
 
Registered: Sep 2007
Location: Mariposa
Distribution: FreeBSD,Debian wheezy
Posts: 811

Rep: Reputation: 179Reputation: 179
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, 12: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, 03: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, 02: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, 07:48 AM   #12
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
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, 12:51 PM   #13
aitorpazos
LQ Newbie
 
Registered: Mar 2010
Posts: 1

Rep: Reputation: 1
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).
 
1 members found this post helpful.
Old 04-28-2011, 01:08 PM   #14
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
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, 01:39 PM   #15
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
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



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 04:30 PM
CPU Temperature in LInux? fedivh Linux - Hardware 9 02-20-2004 03:51 PM
how to get cpu temperature taoweijia Linux - Software 3 02-13-2004 06:04 PM
CPU Temperature Cubiq Programming 3 04-06-2002 11:04 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:14 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
Open Source Consulting | Domain Registration