Monitoring CPU temperature in Linux reduces the risk of thermal throttling, sudden reboots, and long-term hardware damage. Keeping temperature under control helps maintain predictable performance, especially during compiling, gaming, or heavy virtualization workloads where sustained CPU usage is common.

CPU sensors are typically exposed via kernel drivers that read on-die digital temperature sensors and expose them through interfaces such as /sys/class/thermal and the hwmon subsystem. User-space tools like lm-sensors read these values and present them in a human-readable format, grouped by chips, adapters, and sensor labels such as Package id 0 or Core 0.

Access to low-level sensor buses may require elevated privileges, and some older or exotic hardware can expose incomplete or misleading readings. Careful interpretation of values, awareness of the vendor’s maximum recommended temperatures, and avoidance of aggressive probing on fragile systems all help prevent misconfiguration or unnecessary alarm.

Steps to monitor CPU temperature using lm-sensors:

  1. Open a terminal on the system where CPU temperature requires monitoring.
  2. Install the lm-sensors package on a Debian-based system.
    $ sudo apt update && sudo apt install --assume-yes lm-sensors

    On RHEL or Fedora, the package is typically named lm_sensors and installed with dnf, while openSUSE systems use zypper to install the same toolset.

  3. Probe for available hardware sensors using sensors-detect.
    $ sudo sensors-detect
    # sensors-detect revision 3.6.0
    # System: Example Motherboard (ABC123)
    ##### snipped #####
    Driver `coretemp':
      * Chip `Intel digital thermal sensor' (confidence: 9)
     
    Do you want to scan for and add these drivers now? (YES/no):

    Answering YES to all questions is usually safe on mainstream hardware, but very old or unusual systems can behave unpredictably when aggressively probed.

  4. Display current temperature readings with the sensors command.
    $ sensors
    coretemp-isa-0000
    Adapter: ISA adapter
    Package id 0:  +53.0°C  (high = +80.0°C, crit = +100.0°C)
    Core 0:        +50.0°C  (high = +80.0°C, crit = +100.0°C)
    Core 1:        +48.0°C  (high = +80.0°C, crit = +100.0°C)

    Names such as Package id 0 usually refer to the overall CPU package, while entries labeled Core N represent individual cores.

  5. Monitor CPU temperature continuously using watch with sensors.
    $ watch -n 2 sensors
    Every 2.0s: sensors
     
    coretemp-isa-0000
    Adapter: ISA adapter
    Package id 0:  +55.0°C  (high = +80.0°C, crit = +100.0°C)
    Core 0:        +52.0°C  (high = +80.0°C, crit = +100.0°C)
    Core 1:        +51.0°C  (high = +80.0°C, crit = +100.0°C)

    Adjust the -n interval to a larger value when only occasional updates are needed to reduce terminal refresh noise.

  6. Show only CPU-core temperatures using grep on sensors output when a concise view is preferred.
    $ sensors | grep -i 'core'
    Core 0:        +49.0°C  (high = +80.0°C, crit = +100.0°C)
    Core 1:        +48.0°C  (high = +80.0°C, crit = +100.0°C)
  7. Confirm successful monitoring by observing lower temperatures at idle and higher temperatures during normal workload periods in the watch output.

    Consistently high readings near or above the vendor’s specified crit temperature indicate inadequate cooling and can lead to throttling, instability, or hardware failure.

Discuss the article:

Comment anonymously. Login not required.