Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 05-08-2010, 06:50 AM   #1
LQ Newbie
Registered: Apr 2010
Posts: 10

Rep: Reputation: 0
Question how to read CPU temperature and fan speed using c++

I want to read the temperature of my cpu and fan speed using a c++ program and then plot it..

How can i do it?

Old 05-08-2010, 06:58 AM   #2
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198
For the reading part, it might be worth looking at lmsensors source code

Unless you particularly want to write it yourself lmsensors and something like GKrellM will do it.
Old 05-08-2010, 07:04 AM   #3
Registered: Feb 2005
Location: Coventry, UK
Distribution: Home: Gentoo x86/amd64, Debian ppc. Work: Ubuntu, SuSe, CentOS
Posts: 343
Blog Entries: 1

Rep: Reputation: 72
man proc
cat /proc/acpi/fan/fan0
cat /proc/acpi/thermalzone/zone1/foo
depending on what this is for might also work ?

Last edited by djsmiley2k; 05-08-2010 at 07:06 AM.
Old 05-10-2010, 12:26 AM   #4
LQ Newbie
Registered: Apr 2010
Posts: 10

Original Poster
Rep: Reputation: 0
the directories /proc/acpi/fan/ and /proc/acpi/thermalzone/ are empty they do not have fan0 and zone1/foo in it...

Last edited by anu_123; 05-10-2010 at 12:29 AM.


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
Testing whether my fan and CPU temperature monitoring program is ok powah Linux - Hardware 2 05-10-2010 12:06 AM
ACPI can't detect temperature and fan speed madonion87 Linux - Laptop and Netbook 1 11-21-2007 10:13 PM
How can I read CPU temperature ankit4u1 Programming 3 05-30-2007 02:48 AM
Controlling fan speed according to temperature in Kubuntu 7.04 pashabear Linux - Laptop and Netbook 3 05-09-2007 02:00 PM
howto: control CPU fan speed and Northbridge fan speed? hedpe Linux - Software 2 04-18-2005 03:18 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:16 AM.

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
Open Source Consulting | Domain Registration