Monitoring Hardware Temperatures in Linux
Monitoring the temperature of your hardware components is crucial for maintaining system health and performance. In this article, we'll cover how to use lm_sensors, hddtemp, nvidia-smi, and inxi to get temperature readings for various hardware devices in Linux.
On RPM-based systems:
Follow the prompts to scan for various hardware sensors. It's generally safe to accept the default answers by pressing Enter.
To display temperatures in Fahrenheit, use the -f flag:
On RPM-based systems:
Replace /dev/sdX with the appropriate device identifier. If you don't specify a device, hddtemp will show the temperatures of all detected drives:
On RPM-based systems:
On RPM-based systems:
To force inxi to show temperatures in Fahrenheit, use:
Alternatively, you can create or edit the ~/.inxi/config file and add the following line to make this change permanent:
Monitoring the temperature of your hardware components is crucial for maintaining system health and performance. In this article, we'll cover how to use lm_sensors, hddtemp, nvidia-smi, and inxi to get temperature readings for various hardware devices in Linux.
1. lm_sensors
lm_sensors is a widely used tool for monitoring CPU, motherboard, and other system sensors.Installing lm_sensors
On Debian-based systems:
Code:
sudo apt install lm-sensors
On RPM-based systems:
Code:
sudo dnf install lm_sensors
Detecting Hardware Sensors
To detect hardware sensors, run the following command:
Code:
sudo sensors-detect
Follow the prompts to scan for various hardware sensors. It's generally safe to accept the default answers by pressing Enter.
Displaying Sensor Readings
To display sensor readings, use the sensors command:
Code:
sensors
To display temperatures in Fahrenheit, use the -f flag:
Code:
sensors -f
2. hddtemp
hddtemp is used to monitor the temperature of hard drives, including SSDs and NVMe drives.Installing hddtemp
On Debian-based systems:
Code:
sudo apt install hddtemp
On RPM-based systems:
Code:
sudo dnf install hddtemp
Displaying Hard Drive Temperature
To check the temperature of a specific drive, use:
Code:
sudo hddtemp /dev/sdX
Replace /dev/sdX with the appropriate device identifier. If you don't specify a device, hddtemp will show the temperatures of all detected drives:
Code:
sudo hddtemp
3. nvidia-smi
nvidia-smi is a tool specifically for NVIDIA GPUs and provides detailed information about GPU temperature, usage, and other metrics. Note that nvidia-smi is part of the nvidia-cuda package on RPM-based systems and only works with NVIDIA cards.Installing nvidia-smi
On Debian-based systems:
Code:
sudo apt install nvidia-smi
On RPM-based systems:
Code:
sudo dnf install xorg-x11-drv-nvidia-cuda
Displaying GPU Temperature
To display GPU temperature, use:
Code:
nvidia-smi --query-gpu=name,temperature.gpu --format=csv,noheader
4. inxi
inxi is a powerful system information script that can display various hardware details, including temperatures.Installing inxi
On Debian-based systems:
Code:
sudo apt install inxi
On RPM-based systems:
Code:
sudo dnf install inxi
Displaying Temperature Information
To display temperature information, use:
Code:
inxi -s
To force inxi to show temperatures in Fahrenheit, use:
Code:
inxi -sxx
Alternatively, you can create or edit the ~/.inxi/config file and add the following line to make this change permanent:
Code:
TemperatureUnit = fahrenheit
Last edited: