Michael P
Michael P

Reputation: 2067

Ubuntu how to check current CPU temperature in C++

I'm running Ubuntu 14.04. I want to write a c++ program that would give me the current CPU temperature. Is there a system call to get this data? I want to do it periodically, and pretty frequently. What is the best way to do it? Thanks

Upvotes: 0

Views: 2548

Answers (1)

Russ Schultz
Russ Schultz

Reputation: 2689

It appears this would do what you require: package lm_sensors and libsensors (to access it from your programs without reading the values from the sys/ files)

https://en.wikipedia.org/wiki/Lm_sensors

Upvotes: 1

Related Questions