Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 05-24-2007, 04:42 PM   #1
Registered: Apr 2006
Distribution: Red Hat, Fedora
Posts: 97

Rep: Reputation: 15
How can I read CPU temperature


I want to display few metrics of my CPU like CPU occupancy, CPU temperature, CPU throughput and power consumption !

How can i do that in C/C++?

I tried to google, but in vain !! any help would be appreciated ! thanks in advance

Old 05-24-2007, 05:06 PM   #2
Senior Member
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 3,591

Rep: Reputation: 96
You could look at the code that interfaces with libsensors/lm-sensors for either gkrellm or ksensors if you are looking for something to monitor them instead of writing your own then installing lm-sensors running the sensors-detect script and using either of the mentioned programs will do it. This of course assumes that you sensor chip(s) on the motherboard is/are supported by lm-sensors the have their own mail list that you could post to at
Old 05-25-2007, 03:27 AM   #3
Senior Member
Registered: Mar 2004
Location: england
Distribution: Debian, Mint, Puppy, Raspbian
Posts: 3,421

Rep: Reputation: 199Reputation: 199
it's in /proc somewhere

also see man acpi
Old 05-30-2007, 01:48 AM   #4
Registered: Apr 2004
Posts: 101

Rep: Reputation: 15
man proc

provides information about what /proc filesystem contains.
Go through it you might find it useful.


c++, cpu, temperature

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 Sc0pE Linux - Software 2 05-22-2005 05:10 PM
CPU temperature too high Mr_Zet Linux - Laptop and Netbook 9 11-17-2004 10:55 AM
cpu temperature alaios Linux - Hardware 4 09-21-2004 04:30 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 > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:35 PM.

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