LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to read CPU temperature and fan speed using c++ (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-read-cpu-temperature-and-fan-speed-using-c-806632/)

anu_123 05-08-2010 05:50 AM

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?

thanks

catkin 05-08-2010 05:58 AM

For the reading part, it might be worth looking at lmsensors source code http://dl.lm-sensors.org/lm-sensors/snapshots/

Unless you particularly want to write it yourself lmsensors and something like GKrellM will do it.

djsmiley2k 05-08-2010 06:04 AM

or
Code:

man proc
cat /proc/acpi/fan/fan0
cat /proc/acpi/thermalzone/zone1/foo

depending on what this is for might also work ?

anu_123 05-09-2010 11:26 PM

the directories /proc/acpi/fan/ and /proc/acpi/thermalzone/ are empty they do not have fan0 and zone1/foo in it...


All times are GMT -5. The time now is 05:02 AM.