Methods of payment Abuse

How to view and monitor Linux temperature

08.03.2021, 21:58

Do you often have to worry about the temperature of your computer? Probably not if the machine is in good working order and running smoothly. The temperature will not rise above the maximum value set by the manufacturer if there are no factory defects. However, still, overheating can occur, not only because of a hardware problem, but also as a result of a failure in the graphics card driver or an incorrectly configured program to control the cooling system. Often the cause of overheating lies in the accumulation of dust and dirt, which prevents normal system cooling and heat dissipation. This is usually seen on older machines.

What is necessary

It is worth understanding that overheating can lead to quite unpleasant consequences. Be sure to monitor the state of your computer system. It is especially useful if there is a service that monitors the temperature value and notifies the user if it rises. In this instruction we will consider how to see the temperature value and organize a monitoring system. Linux has a special set of tools designed for this task.

So, to accomplish the task we will need the following standard tools:

  1. lm-sensors - extracts data from hardware sensors on the motherboard to monitor temperature, voltage.
  2. hddtemp - measures the temperature of hard disks.
  3. psensor - a graphical temperature monitoring utility that allows you to see the Linux temperature, for CPU, video card, hard disks.

Our next task is to install the components.

Installing the components

Since lm-sensors works based on the information provided by lm-sensors and hddtemp, it is these components that need to be installed first. To do this, run this command:

$ sudo apt install lm-sensors hddtemp psensor

If you need the most up-to-date version of these components, then the command needs to be modified slightly:

$ sudo add-apt-repository ppa:jfi/ppa

sudo apt update

sudo apt install lm-sensors hddtemp psensor

That is, you need to add the PPA from the developers to the system.

Installing psensor in Fedora and other Red Hat-based distributions looks about the same:

$ sudo yum install lm_sensors hddtemp psensor

Configuring temperature monitoring

First of all, we configure the low-level tools designed to read information, which include lm_sensors and hddtemp. By installing them, you can provide the system with temperature monitoring:

$ sudo sensors-detect

This command starts the ls_sensors configuration wizard. The user must answer all questions with Y. Next, it will detect the built-in hardware sensors in the system, and automatically detect the appropriate drivers.

Once the sensor scan is complete, the user will be prompted to add the detected kernel modules to the autoloader:

НАСТРОЙКА LM_SENSORSIn Ubuntu or Debian, the modules will be added to /etc/modeuls. To automatically load the required modules, just add lm_sensors to autoload:

$ sudo systemctl enable lm-sensors

Next, we can view the temperature of the CPU and other hardware components using the following command:

$ sensors

команда sensors

Configuring DDTEMP

To start monitoring the temperature of hard disks, run hddtemp as a daemon, replace /dev/sda with the address of your disk:

$ sudo hddtemp -d /dev/sda

Repeat this operation for each system disk. Another important nuance is that the program should be added to the autoload list.

Measuring and monitoring temperatures

You can also monitor the temperature in Linux with psensor, a special graphical utility. You can run it either by command or from the main menu of the system. The command is launched as follows:

$ psensors

ИЗМЕРЕНИЕ И МОНИТОРИНГ ТЕМПЕРАТУРЫ

In the main window of the program and select Options. Before you will open a list of sensors that display the temperatures of the main components. You can choose which of the sensors to follow.

Параметры

To set an alarm for a specific sensor, click on the Alarm tab. By default, temperature in psensor is measured in degrees Celsius. Recent versions also support conversion to degrees Fahrenheit.

That's it, the temperature of your computer's most important components will now always be under your control. Be sure to add it to your autoloader to ensure you can work with it.