LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   How to get CPU temperature in linux (http://www.linuxquestions.org/questions/programming-9/how-to-get-cpu-temperature-in-linux-598658/)

tduglas 11-10-2007 04:28 PM

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?

gilead 11-10-2007 04:32 PM

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...

Tinkster 11-10-2007 07:10 PM

If your machine uses ACPI...

cat /proc/acpi/thermal_zone/THM0/temperature


Cheers,
Tink

tduglas 11-11-2007 03:17 PM

Quote:

Originally Posted by Tinkster (Post 2954770)
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

bigearsbilly 11-12-2007 03:11 AM

take the cover off and put your finger on it
;)

kromberg 11-13-2007 04:28 PM

Quote:

Originally Posted by bigearsbilly (Post 2955967)
take the cover off and put your finger on it
;)

Writting the man page for that would be way too complicated :D

Keith

Shm00nix 02-03-2010 03:04 AM

Slight ACPI path change
 
Quote:

Originally Posted by Tinkster (Post 2954770)
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

wje_lq 02-03-2010 08:46 AM

Quote:

Originally Posted by bigearsbilly (Post 2955967)
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.

federico.a 02-13-2010 12:49 PM

In Ubuntu try...
 
Code:

acpi -t

icarstudio 05-13-2010 03:54 AM

Thx! Also i'll tell U, that on my OpenSusu 11.1 works both:
cat /proc/acpi/thermal_zone/THRM/temperature
acpi -t

raviteja_s 08-09-2010 02:36 AM

Take the Thermometer and check it...
 
it will work..........

MTK358 08-09-2010 07:48 AM

Quote:

Originally Posted by raviteja_s (Post 4060441)
it will work..........

Is that a joke or spam? Do you realize this thread is a few months old?

aitorpazos 04-28-2011 12:51 PM

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).

TobiSGD 04-28-2011 01:08 PM

Quote:

Originally Posted by tduglas (Post 2955490)
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.

crts 04-28-2011 01:39 PM

Quote:

Originally Posted by TobiSGD (Post 4339660)
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 ... :)


All times are GMT -5. The time now is 06:52 AM.