7

What is a good way to get the CPU temperature from the Centos command line?

Came across this tool, however if I understood the documentation correctly (which I may not have) it seems to install a service that monitors the temperature continuously, I'd just like to poll it manually every once in a while: http://lm-sensors.org/

From: http://lm-sensors.org/wiki/FAQ/Chapter1

How often are the sensor values updated?

Our drivers usually updates the values once a second or two. If you read the values faster than that, you will get the 'old' values again. It is not possible to make it faster for some chips due to their design.

Thanks!

2 Answers 2

6

Install lm-sensors by -

 yum install lm_sensors

Temperature is checked by below command

sensors

And it will show results like -

[root@localhost test]# sensors
acpitz-virtual-0
Adapter: Virtual device
temp1:        +27.8°C  (crit = +100.0°C)
temp2:        +29.8°C  (crit = +100.0°C)

coretemp-isa-0000
Adapter: ISA adapter
Physical id 0:  +72.0°C  (high = +80.0°C, crit = +99.0°C)
Core 0:         +70.0°C  (high = +80.0°C, crit = +99.0°C)
Core 1:         +70.0°C  (high = +80.0°C, crit = +99.0°C)
Core 2:         +72.0°C  (high = +80.0°C, crit = +99.0°C)
Core 3:         +70.0°C  (high = +80.0°C, crit = +99.0°C)

If you only want a specific sensors readout, use grep

sensors | grep "Core 0:"
5

1) If your system supports acpi, you can get the temparature by running acpi -t. I'm not sure whether the command is available by default in CentOS though.

2) The paragraph that you quoted from the lm-sensors FAQ does not imply that a service will be running in the background, it merely refers to the fact that the values returned by the lm-sensors modules are cached, and not read from the hardware every time.

1
  • 1
    that is correct, lm-sensors does not run as a daemon. you must run 'sensors' (as root) to execute it. if you use some kind of gui monitor (I used to use HardwareSensorsMonitor as a panel applet in Gnome2), then the sensors utility is being run with each refresh. Jul 22, 2013 at 3:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .