How can I monitor the CPU temperature under linux?

331,093

Solution 1

Using 'sensors' (from lm-sensors) and 'watch' (from procps pkg), you can real-time monitor sensors data on the command line via:

watch -n 1 -d sensors

This will display sensors every 1 sec and highlight the difference from the previous second.

Every 1.0s: /usr/bin/sensors

...
temp1:       +55C  (high =   +50C, hyst =   +45C)   sensor = thermistor   ALARM
temp2:     +35.0C  (high =   +80C, hyst =   +75C)   sensor = thermistor
temp3:     +35.0C  (high =   +80C, hyst =   +75C)   sensor = thermistor

Solution 2

lm-sensors

Lm-sensors is a hardware health monitoring package for Linux. It allows you to access information from temperature, voltage, and fan speed sensors. It works with most newer systems. This package contains programs to help you set up and read data from lm-sensors.

To install use :

# sudo apt-get install lm-sensors sensors-applet

To use :

# sensors-detect
...
# sensors
V1.5:      +2.467 V  (min =  +1.42 V, max =  +1.58 V)   ALARM
VCore:     +1.479 V  (min =  +1.48 V, max =  +1.63 V)   ALARM
V3.3:      +3.373 V  (min =  +3.13 V, max =  +3.47 V)
V5:       +5.000 V  (min =  +4.74 V, max =  +5.26 V)
V12:      +11.734 V  (min = +11.38 V, max = +12.62 V)
CPU_Fan:   2299 RPM  (min = 4000 RPM)                     ALARM
fan2:         0 RPM  (min =    0 RPM)
fan3:      1057 RPM  (min =    0 RPM)
fan4:         0 RPM  (min =    0 RPM)
CPU:      +41.50°C  (low  =   +10°C, high =   +50°C)
Board:    +35.25°C  (low  =   +10°C, high =   +35°C)
Remote:   +35.50°C  (low  =   +10°C, high =   +35°C)     ALARM
CPU_PWM:   144
Fan2_PWM:  112
Fan3_PWM:  112
vid:      +1.550 V  (VRM Version 9.0)

or add the applet to your taskbar.

enter image description here


You could also try the computertemp applet.

Ubuntu Package

Homepage

Computer Temperature Monitor is a little applet for the GNOME desktop that shows the temperature of your computer CPU and disks on screen.

It also allows you to log temperatures to a file. You can set alarms to notify you when a tempertature is reached. Several monitors can be added to the panel to monitor different sensors. It is designed to look like CPU Frequency Gnome applet, so they match each other on panel.

To install use :

sudo apt-get install computertemp

and then add to your taskbar

enter image description here

Solution 3

I have a Dell server (Poweredge R420) running Fedora / Red Hat Linux. I installed lm_sensors, but sensors gave me a message saying the kernel drivers were not loaded. I used sensors-detect to find out which sensor I needed, and it turned out I needed IPMI.

Now follows a summary of the probes I have just done.
Just press ENTER to continue:

Driver `ipmisensors':
  * ISA bus, address 0xca8
    Chip `IPMI BMC KCS' (confidence: 8)

Warning: the required module ipmisensors is not currently installed
on your system. If it is built into the kernel then it's OK.
Otherwise, check http://www.lm-sensors.org/wiki/Devices for
driver availability.

I checked the page, that advised me to use ipmitool. I installed it, but still it wouldn't work:

$ ipmitool sensor
Could not open device at /dev/ipmi0 or /dev/ipmi/0 or /dev/ipmidev/0: No such file or directory
Get Device ID command failed
Unable to open SDR for reading

After some more research, I came across this page: http://osdir.com/ml/hardware.ipmitool.devel/2008-02/msg00012.html

Their script ipmimod.sh worked out-of-the-box for me:

#!/bin/bash

#IPMI kernel module installer for Redhat-style machines
#dranch-3r7Miqu9kMnR7s880joybQ@xxxxxxxxxxxxxxxx

#07/26/06 - use absolute paths for modprobe
#05/01/06 - orig version

/sbin/modprobe ipmi_devintf

maj=`cat /proc/devices | awk '/ipmidev/{print $1}'`
echo $maj
if [ -c /dev/ipmi0 ]
then
   rm -f /dev/ipmi0
   /bin/mknod /dev/ipmi0 c $maj 0
else
   /bin/mknod /dev/ipmi0 c $maj 0
fi

IPMI_DRIVERS="ipmi_si ipmi_si_drv ipmi_kcs_drv"
for driver in $IPMI_DRIVERS; do
  find /lib/modules/`uname -r`/kernel/drivers/char/ipmi | grep $driver > /dev/null
  RETURN_VALUE=$?
  if [ $RETURN_VALUE -eq 0 ] ; then
    #Here are specific memory locations for Supermicro AOC-type IPMI cards
    /sbin/modprobe $driver type=kcs ports=0xca8 regspacings=4
    break
  fi
done

After running that, I am finally able to see the CPU temperature:

$ ipmitool sensor | grep Temp
Inlet Temp       | 24.000     | degrees C  | ok    | na        | -7.000    | 3.000     | 42.000    | 47.000    | na
Temp             | na         | degrees C  | na    | na        | 3.000     | 8.000     | 77.000    | 83.000    | na
Temp             | na         | degrees C  | na    | na        | 3.000     | 8.000     | 77.000    | 83.000    | na

I hope this helps anyone with dell servers having difficulty to get the temperatures.

Solution 4

Linux allows you to access temperature info sensors. It works with RH6.2x64.

This driver contains read support using lm-sensors:

type

modprobe coretemp
sensors

Solution 5

I discovered other software with gui to monitor temperatures. The name of the software is: Psensor: https://wpitchoune.net/psensor/

And see the article from Internet: https://www.tecmint.com/psensor-monitors-hardware-temperature-in-linux/

To install on Ubuntu/Mint, run this command at your terminal:

sudo apt install psensor

To run the application, just run this:

sudo psensor

Thanks.

Share:
331,093

Related videos on Youtube

chris
Author by

chris

Updated on September 17, 2022

Comments

  • chris
    chris over 1 year

    How do I monitor and display the CPU temperature using Linux?

    • Admin
      Admin over 11 years
      It so nice to see that such short, quick and precise questions get so much response :-)
  • Admin
    Admin over 14 years
    If you want it on screen I like using gkrellm which uses lm-sensors for the detection.
  • Admin
    Admin over 14 years
    If you want it on screen and don't want to use gkrellm, you can also use conky instead.
  • Jacob Jan Tuinstra
    Jacob Jan Tuinstra over 11 years
    Why not through in the Fahrenheit syntax?
  • johnnyB
    johnnyB over 11 years
    easy, add an '-f' option to the sensors command above
  • Admin
    Admin over 10 years
    If you're on a redhat, your package may be called lm_sensors (underscore instead of regular dash)
  • Admin
    Admin almost 10 years
    Same thing on Arch, it’s lm_sensors.
  • William Everett
    William Everett over 9 years
    Worth noting that you need to install the lm-sensors package for this to work.
  • Admin
    Admin about 9 years
    Just want to add that I've always had to reboot after doing the sensor detect for the first time.
  • Wellington1993
    Wellington1993 over 6 years
    To configure sensors run this command and type yes for all questions: sudo sensors-detect