- How to Get CPU Temperature on Ubuntu Linux
- 1) Check CPU temperature using Lm_Sensors
- Detecting compatible sensors on Ubuntu Linux
- Display CPU temperature in the command line
- 2) Check CPU temperature with Psensor GUI tool
- 3) Using ‘Hardinfo’ to check CPU temperature
- Using ‘i7z’ to find CPU temperature
- Conclusion
- Мониторинг температуры Linux
- Что мы будем использовать?
- Установка компонентов
- Настройка мониторинга температуры Linux
- 1. Настройка lm_sensors
- Настройка hddtemp
- Измерение и мониторинг температуры
- Выводы
- How to check CPU temperature on Ubuntu Linux
- Procedure for monitoring CPU and HDD temperatures on Ubuntu
- Check CPU temperature in Ubuntu Linux
- Install lm-sensors in Ubuntu Linux
- Display CPU temperature in the command line
- How can I show the CPU temperature in the GNOME panel
- How to install hddtemp in Ubuntu Linux
- How to see hard disk temperature in Ubuntu
- Use disks & storage GUI tool to view hard disk temp
- How to monitor Nvme ssd temperature in Ubuntu
- What to do when a laptop gets way too hot
- Conclusion
How to Get CPU Temperature on Ubuntu Linux
Hardware overheating often creates a bad performance of your system. Monitoring hardware temperature can help you diagnose any CPU overheating problems of the system. The source of laptop overheating normally comes from extensive CPU, GPU (video cards), or hard disk temperature.
If your laptop is getting hot, make sure the laptop is positioned properly so it won’t restrict airflow. You must have a good, clean laptop cooler, not dusty, and remove any unwanted software that uses high CPU. Also running the laptop in power saving mode reduces overheating.
In this tutorial, we will learn how to get the CPU temperature on Ubuntu Linux from command line as well as from Desktop.
1) Check CPU temperature using Lm_Sensors
Lm_sensors is a command-line tool that is used to show the current readings of all chip sensor data, including CPU temperature. By default, Lm_sensors are not installed in most Linux distributions, therefore, we have to install them ourselves.
So first let’s check how to install lm-sensors package on various Linux distros.
On Ubuntu/Debian
Open the terminal on Ubuntu by pressing the shortcut key CTRL + ALT + T from your keyboard. Then install Lm_Sensors by running the following command which I have tested on Ubuntu 18.04, Ubuntu 20.04, and Debian 10:
Install Psensor Server if you want to print the temperature and fan speed of a remote server.
On Arch Linux
To install lm_sensors on Arch Linux, enable the extra repository in ‘/etc/pacman.conf’. Then run the following pacman command from the terminal:
On Fedora
Use dnf command to install lm_sensors on Fedora Linux.
On CentOS/RHEL
Use yum command to install lm_sensors on CentOS 7 and RHEL 7
Detecting compatible sensors on Ubuntu Linux
Next, we need to detect hardware monitoring chips installed in our laptops. So now we can start the detection of our laptop hardware sensors. This will provide information about:
- Sensors embedded in CPUs and other super I/O chips
- Hardware monitoring chips accessed through I/O ports and SMBus/I2C bus on our system
We do that by typing command sudo sensors-detect:
Display CPU temperature in the command line
We have successfully installed lm-sensors package and we have successfully detected supported sensors on our Ubuntu Linux powered laptop.
Now we can execute the following command to see temperature data:
Note that the results will differ for your computer.
You can also use the watch command to run sensors command constantly, which will display sensor output changes on screen:
2) Check CPU temperature with Psensor GUI tool
We’re going to use a GUI tool, Psensor, that allows you to monitor hardware temperature on Linux.
With Psensor you can check the following:
- The temperature of the motherboard and CPU sensors and NVidia GPUs
- The temperature of the hard disk drives
- The rotation speed of the fans
- Monitor CPU usage
The latest version of Psensor also provides an applet indicator for Ubuntu and thus it makes the monitoring of hardware temperature even easier on Ubuntu. You can choose to display the temperature right in the top panel itself. It can even send a desktop notification when the temperature exceeds the limit.
We can proceed with the installation of Psensor by using the command below:
Ubuntu/Debian
Fedora
CentOS and RHEL
Once installed, run the application by looking for it in the Unity Dashboard. On the first run, you may configure which stats (sensors) you want to collect with Psensor.
If you want to show the CPU statistics including temperature in the top panel, go to ‘Sensor Preferences’. Then under the ‘Application Indicator’ menu, select the component for which you want to display the temperature. Then check the ‘Display sensor’ in the label option.
3) Using ‘Hardinfo’ to check CPU temperature
Hardinfo is a system profiler and benchmark tool used in Linux to display hardware information in GUI. You can also check CPU temperature from the GUI — Devices — Sensors.
On Ubuntu and Debian
On Arch Linux you can find hardinfo in community repo
Run the following command from the terminal to display hardware information on GUI.
Using ‘i7z’ to find CPU temperature
i7z is a command-line tool to print CPU information on Intel Core i7, i5, i3 processors, and also reports CPU temperature. i7z needs to be run as root or user with sudo privilege.
To install on ubuntu run the following command:
Conclusion
Apart from this, you can try using TLP and thermald,can help you control CPU temperature on Linux. Cpufreq is another tool that can help you save battery and reduce the laptop overheating which works very well on Ubuntu.
Few years before I used ‘Conky’ which is a lightweight desktop system monitor that can show stats of CPU, memory, swap space, disk storage, temperatures, processes, network interfaces, battery power, etc.
If you want to check temperatures without 3rd party tools, look in /sys/devices/virtual/thermal/thermal_zone1/temp file.
To check hard disk temperature you can install hddtemp package.
Finally, if you have any questions or feedback, feel free to leave a comment.
Источник
Мониторинг температуры Linux
В большинстве случаев нам не нужно беспокоиться о температуре компьютера. Все устроено так что температура не будет превышать максимальную если у вашего оборудования нет никаких производственных дефектов. Но перегрев могут вызвать не только аппаратные ошибки, это также может произойти из-за багов в драйвере графической карты или неправильно настроенной программы управления вентилятором. Частой причиной перегрева также может быть пыль, грязь, мусор попавшие в систему охлаждения (вентилятор, радиатор). Такое часто происходит со старым оборудованием.
Перегрев может вызвать очень серьезные повреждения вашего компьютера, так что следите за температурой вашей системы. Еще лучше если есть служба контроля температуры, которая предупредит вас если температура начнет сильно расти. В этой инструкции я расскажу как настроить мониторинг температуры Linux. В операционной системе Linux есть специальный набор утилит, которые предназначены для того, чтобы выполнять контроль температуры linux.
Что мы будем использовать?
Давайте рассмотрим утилиты, которые мы сегодня будем использовать:
- lm-sensors — программный инструмент, извлекающий данные из аппаратных датчиков на материнской плате для мониторинга температуры, напряжения, влажности и т д;
- hddtemp — инструмент для измерения температуры жестких дисков;
- psensor — графическая утилита для мониторинга температуры, которая позволяет посмотреть температуру Linux, для процессора, видеокарты, жестких дисков и других компонентов, которые поддерживают эту функцию.
Установка компонентов
Программа psensor отображает температуру на основе информации, полученной от lm-sensors и hddtemp. Поэтому сначала необходимо установить эти инструменты. Для установки в Debian или Ubuntu выполните:
sudo apt install lm-sensors hddtemp psensor
Если вы хотите установить самую новую версию этих компонентов, нужно добавить сначала PPA от разработчиков в систему:
sudo add-apt-repository ppa:jfi/ppa
sudo apt update
sudo apt install lm-sensors hddtemp psensor
Установка psensor в Fedora и других дистрибутивах, основанных на Red Hat будет выглядеть аналогично:
sudo yum install lm_sensors hddtemp psensor
Настройка мониторинга температуры Linux
Сначала нужно настроить низкоуровневые инструменты для считывания данных о температуре компонентов lm_sensors и hddtemp. Начнем с lm_sensors. После этого вы уже сможете посмотреть температуру linux.
1. Настройка lm_sensors
Для запуска мастера настройки ls_sensors выполните команду:
Отвечайте Y на все вопросы. Утилита попытается обнаружить все доступные в системе встроенные аппаратные датчики (для процессора, видеокарты, памяти и других микросхем), а также автоматически определить подходящие драйвера для них.
Когда сканирование датчиков завершится вам будет предложено добавить обнаруженные модули ядра в автозагрузку:
В Ubuntu или Debian модули будут добавлены в /etc/modeuls. А в Fedora будет создан файл /etc/sysconfig/lm_sensors. Для автоматической загрузки нужных модулей достаточно добавить lm_sensors в автозагрузку:
sudo systemctl enable lm-sensors
Теперь вы можете посмотреть температуру процессора Linux и других аппаратных компонентов с помощью команды sensors:
Настройка hddtemp
Еще вам нужно запустить hddtemp для контроля температуры жестких дисков. Выполните эту команду для запуска hddtemp в качестве демона, /dev/sda замените на адрес своего диска.
sudo hddtemp -d /dev/sda
Это нужно сделать для каждого диска. Также необходимо добавить эту программу в автозагрузку.
Измерение и мониторинг температуры
Теперь можно начать мониторинг температуры linux с помощью psensor. Для этого просто запустите программу. Вы можете сделать это с помощью главного меню или же выполнив команду:
Вызовите контекстное меню в главном окне программы и выберите Параметры. Здесь вы увидите список доступных датчиков. Вы можете выбрать за какими датчиками нужно наблюдать.
Еще можно установить уровень тревоги для каждого датчика на вкладке Alarm. Когда температура Linux превысит заданную вы получите уведомление.
По умолчанию температура в psensor измеряется в градусах Цельсия. В последних версиях также есть поддержка конвертации в градусы по Фаренгейту.
Выводы
Дальше, чтобы программа работала постоянно осталось добавить ее в автозагрузку. Теперь температура процессора linux всегда будет под контролем и ваш компьютер точно не перегреется. Если у вас остались вопросы, спрашивайте в комментариях!
Источник
How to check CPU temperature on Ubuntu Linux
H ow do I check CPU temperature in Ubuntu Linux using a command line and GUI tools on my Thinkpad laptop or Desktop computer?
One of the most common complaints is the overheating laptop, especially older models. Laptop components are tightly put together to each other. So there is very little room for air movement in thinner laptops. If your laptop overheats, it can cause some damage to your body as well as the hardware parts. Therefore monitoring hardware temperature is essential. In this tutorial, you will learn how to check CPU temperature in Ubuntu Linux.
Tutorial details | |
---|---|
Difficulty level | Easy |
Root privileges | Yes |
Requirements | Ubuntu Linux |
Est. reading time | 4 minutes |
Procedure for monitoring CPU and HDD temperatures on Ubuntu
- Open the terminal application.
- Install the lm-sensors and hddtemp packages in Ubuntu using the sudo apt install hddtemp lm-sensors .
- Run hddtemp command to see SSD and hard drive temperature in Ubuntu.
- Execute sensors command to find out CPU temperature in Ubuntu Linux.
Let us view processor temperature including SSD/HDD in details for Ubuntu desktop or server.
Check CPU temperature in Ubuntu Linux
The sensors command is used in Linux to show the current readings of all sensor chips including CPU temp. The hddtemp command will show you the temperature for SSD and HDD. You need to install and configure the lm-sensors package as well as hddtemp. You can search it using the following syntax:
apt-cache search lm-sensors
apt-cache search hddtemp
To install these packages on Ubuntu, run the following apt command or apt-get command in a terminal:
sudo apt update
sudo apt upgrade
Install lm-sensors in Ubuntu Linux
- Sensors embedded in CPUs and other super I/O chips
- Hardware monitoring chips accessed through I/O ports and SMBus/I2C bus on your system
Type the following command:
sudo sensors-detect
Display CPU temperature in the command line
How can I show the CPU temperature in the GNOME panel
Install Freon and Sensors extension for Ubuntu Linux desktop:
How to install hddtemp in Ubuntu Linux
Run the following apt command:
sudo apt install hddtemp
How to see hard disk temperature in Ubuntu
Simply type:
hddtemp
sudo hddtemp SATA:/dev/sda
Sample outputs:
Use disks & storage GUI tool to view hard disk temp
Hard disks have a built-in health-check tool called SMART (Self-Monitoring, Analysis, and Reporting Technology), which continually checks the disk for potential problems. SMART also warns you if the disk is about to fail, helping you avoid loss of important data. It also displays hard disk temperature. Run:
gnome-disks
How to monitor Nvme ssd temperature in Ubuntu
First install nvme-cli, run:
sudo apt install nvme-cli
Now use the nvme command as follows to get list of all NVMe devices and namespaces on machine:
sudo nvme list
Sample outputs:
sudo nvme smart-log /dev/nvme0
One can filter output using the grep command:
sudo nvme smart-log /dev/nvme0 | grep temperature
- No ads and tracking
- In-depth guides for developers and sysadmins at Opensourceflare✨
- Join my Patreon to support independent content creators and start reading latest guides:
- How to set up Redis sentinel cluster on Ubuntu or Debian Linux
- How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
- How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
- A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
- How to protect Linux against rogue USB devices using USBGuard
Join Patreon ➔
What to do when a laptop gets way too hot
- Open your laptop and remove (blow out) all the dust from fans and hardware.
- Buy a good laptop cooler to place your laptop on.
- Make sure your Thinkpad laptop positioned on a flat and hard surface.
- Shutdown unwanted Linux apps that use lots of CPU, ram, hard drive, and stress out your system.
- Above all use power saving mode on your laptop.
Conclusion
In conclusion, keep your laptop fan clean and dust free to reduce the temperature. In some extreme cases, you may need to replace a heat sink to keep a hot component such as a processor cool. Similarly, use the quality thermal paste to fill in the gaps and allow for better transfer of heat from the heat spreader to the heatsink. I hope to find out CPU temperature in Ubuntu Linux help you to keep your laptop healthy and use it for a longer time.
🐧 Get the latest tutorials on Linux, Open Source & DevOps via
Источник