less than 1 minute read

Checking Linux CPU Temperatures

When working with physical systems it may be important to track and/or record CPU temperatures.

Quick and Dirty

Requires no add-on installed packages

    paste <\(cat /sys/class/thermal/thermal\_zone\*/type) <\(cat /sys/class/thermal/thermal\_zone\*/temp) | column -s \$'\t' -t | sed 's/\(.\)..\$/.°C/'

    e.g.

    gwatts@pr-monitor-01:~\$ paste <\(cat /sys/class/thermal/thermal\_zone\*/type) <\(cat /sys/class/thermal/thermal\_zone\*/temp) | column -s \$'\t' -t | sed 's/\(.\)..\$/.°C/'
    cpu-thermal  79.3°C

Using lm-sensors

  1. Install lm-sensors

     sudo apt install hddtemp lm-sensors
    
  2. Run sensors

     gwatts@pr-monitor-01:~$ sensors
     rpi_volt-isa-0000
     Adapter: ISA adapter
     in0:              N/A
    
     cpu_thermal-virtual-0
     Adapter: Virtual device
     temp1:        +67.7°C
    
  3. Or, watch sensors

     watch sensors
    
     Every 2.0s: sensors                                            pr-monitor-01: Fri Aug 13 13:32:57 2021
     rpi_volt-isa-0000
     Adapter: ISA adapter
     in0:              N/A
    
     cpu_thermal-virtual-0
     Adapter: Virtual device
     temp1:        +69.6°C
    

Updated: