1. 程式人生 > >How to monitor system temperature on Linux

How to monitor system temperature on Linux

In most cases, you are not supposed to be worried about the temperature of your computer. Barring manufacturing defects, hardware is designed so that its temperature does not exceed maximum operating temperature. But even without any hardware fault, overheating can occur due to various software issues, e.g., buggy graphics card driver, misconfigured fan control program, malfunctioning CPU frequency scaling daemon, etc.

Overheating may become serious enough to cause permanent damage on your hardware. So watch out for any overheating issue in your system. Even better, have temperature monitoring system in place, so that you will be alerted if system temperature suddenly goes up.

In this tutorial, I will describe how to monitor system temperature on Linux.

There are several user space tools on Linux, which allow you to check and monitor temperature of various system components.

lm-sensors is a software tool that draws from hardware embedded sensors to monitor temperatures, voltage, humidity and fans. hddtemp is a tool that can measure the temperature of hard drives from

S.M.A.R.T. readings. psensor is a graphical front-end for temperature monitoring, which visualizes temperature readings from CPUs, NVidia/ATI/AMD GPUs, hard disks, etc.

In the following, I will describe how to set up psensor to monitor the temperature of CPUs and hard drives.

Install psensor on Linux Desktop

psensor can visualize system temperature based on the information obtained from other tools such as lm-sensors and hddtemp. Thus you need to install psensor along with those prerequisites.

To install psensor on Debian or Ubuntu:

$ sudo apt-get install lm-sensors hddtemp psensor

Another way to install psensor on Ubuntu is to use their PPA repository which contains a more recent version of psensor.

$ sudo add-apt-repository ppa:jfi/ppa
$ sudo apt-get update
$ sudo apt-get install lm-sensors hddtemp psensor

To install psensor on Fedora:

$ sudo yum install lm_sensors hddtemp
$ sudo yum install gcc gtk3-devel GConf2-devel lm_sensors-devel cppcheck libatasmart-devel libcurl-devel json-c-devel libmicrohttpd-devel help2man libnotify-devel libgtop2-devel make
$ wget http://wpitchoune.net/psensor/files/psensor-0.8.0.3.tar.gz
$ tar xvfvz psensor-0.8.0.3.tar.gz
$ cd psensor-0.8.0.3
$ ./configure
$ make
$ sudo make install

Due to the requirement for GTK3 libraries, psensor is not compatible with the GNOME 2 desktop of CentOS or RHEL 6.

Configure psensor on Linux

Before launching psensor, you need to configure lm_sensors and hddtemp first.

lm_sensors configuration

To configure lm_sensors, run the following command. Choose YES to every question.

$ sudo sensors-detect

This command will probe for and detect embedded sensors in your hardware (including CPUs, memory controllers, I/O chips), and automatically determine which driver modules need to be loaded to check temperature on your system.

Once sensor probing is completed, you will be asked to add detected driver module(s) to /etc configuration, so they can be loaded automatically upon boot.

On Debian or Ubuntu, detected driver modules will be added to /etc/modules. On Fedora, the driver information will be added to /etc/sysconfig/lm_sensors.

Next, proceed to load necessary modules as follows.

On Ubuntu:

$ sudo service module-init-tools start

On Debian:

$ sudo /etc/init.d/kmod start

On Fedora:

$ sudo service lm_sensors start

hddtemp configuration

You also need to launch hddtemp which monitors the temperature of hard drives.

Run the following command to launch hddtemp as a daemon. Replace "/dev/sda" with the disk drive to monitor on your system.

$ sudo hddtemp -d /dev/sda

Monitor System Temperature with psensor

To start monitoring temperature with psensor, simply run:

$ psensor

The psensor window will show a list of available sensors, and visualize temperature readings from these sensors. You can selectively enable or disable each sensor.

Optionally, you can set an alarm level for each sensor, so that you can be notified when the temperature from a sensor exceeds a threshold.

The default temperature unit used by psensor is Celsius. A recent version (0.7--0.8) of psensor can convert temperature unit between Celsius and Fahrenheit. If the version of psensor you are using is outdated (e.g., 0.6.x), and does not have unit conversion, install psensor from its PPA repository (for Ubuntu users) or build it from its source (for Debian users).


相關推薦

How to monitor system temperature on Linux

In most cases, you are not supposed to be worried about the temperature of your computer. Barring manufacturing defects, hardware is desi

How-to Install VMware Tools on Debian Stretch 9 32/64bit Linux+GNU

網絡配置 bsp install com tutorial des linux 虛擬機 top 在虛擬機VMWARE上安裝debian9 安裝vmwaretools時候遇到問題 詢問我IFCONFIG安裝在哪裏? 新版的debian不知道是用戶權限問題還是使用了其他網絡

How to fix yum errors on CentOS, RHEL or Fedora

http dsm list plain ... prop package cat cse Yum is a package management tool for installing, updating and removing rpm packages on Red

WPF:How to display a Bitmap on Image control

bug con 另一個 spa and maps api 如果 reat 一個Bitmap文件,叫做screenShotFile, 你可以這樣顯示到Image控件上。 BitmapImage bi = new BitmapImage();

How to Install VMware Tools on RHEL 7/CentOS 7

advance paste rman rip prot disable features box etc The original address Mware Tools is one of important components for virtual mach

How to monitor mongodb replica set using prometheu

global rom dash off afa nload .com fir ash How to monitor mongodb replica set using prometheus 監控mongodb replica set其實有很多方式: Using zabbi

How to increase JVM memory on Tomcat 8

  https://docs.oracle.com/cd/E40520_01/integrator.311/integrator_install/src/cli_ldi_server_config.html   Creating a setenv file It is

how to mount /system as read/write in android? 在除錯RK3288的OV2718的驅動時,需要remount /system目錄為rw以push檔案到/system/lib/hw目錄下,常規的是用adb登入上去後以root許可權執行mount -o re

在除錯RK3288的OV2718的驅動時,需要remount  /system目錄為rw以push檔案到/system/lib/hw目錄下,常規的是用adb登入上去後以root許可權執行mount -o remount,rw /system即可,然而在拿的新板子後這麼做失效了,於是百

How To Add Swap Space on Ubuntu 16.04

Introduction One of the easiest way of increasing the responsiveness of your server and guarding against out-of-memory errors in applications is to ad

How to use common workflows on Amazon SageMaker notebook instances

Amazon SageMaker notebook instances provide a scalable cloud based development environment to do data science and machine learning. This blog post

How to run custom application on SONM

How to run custom application on SONMThis little guide will help experienced SONM users to run custom applications on SONM suppliers. If you don’t know any

How to do Deep Learning on Graphs with Graph Convolutional Networks

Observe that the weights (the values) in each row of the adjacency matrix have been divided by the degree of the node corresponding to the row. We apply th

How to list your cryptocurrency on exchange

How to list your cryptocurrency on exchangeSo one day you woke up with a plan of creating a new coin. Then somehow you’ve forked suitable codebase from Git

How to list your cryptocurrency on an exchange

How to list your cryptocurrency on an exchangeSo one day you woke up with a plan of creating a new coin. Then somehow you’ve forked suitable codebase from

How to create beautiful pipelines on Elixir with Opus

Use caseAt Quiqup, we have a business model that requires our drivers to perform different kinds of work. For example, depending on who is ordering, our dr

How to Promote Your Bot on a Budget

How to Promote Your Bot on a BudgetChatbots are taking over the business world. Every month, people send more than a billion messages to businesses and org

How to mock final classes on Kotlin using Mockito 2

One of the most common issues for Kotlin, as we talked about in a previous article, is that all classes and functions are closed by default. This mea

How to make unit test on Android with Kotlin (KAD 22)

Of course, Kotlin also allows us to do unit tests in a very simple way, and very similar to what we’re used in Java. There are some small complicatio

How to use Dagger 2 on Android with Kotlin (KAD 20)

Virtually everyone who wants to create code on Android in a decoupled and easy-to-test way, resorts to Dagger sooner or later. Although there is some

How to Enable MFA Protection on Your AWS API Calls

Multi-factor authentication (MFA) provides an additional layer of security for sensitive API calls, such as terminating Amazon EC2 instances or de