Monitoring Your System Using psensor

Nam Luong
Nam Luong
  • Updated

Document Scope

The package psensor is a graphical temperature monitor for Linux. It allows users to monitor the temperature of various hardware components such as CPU, GPU, motherboard, and hard drives in real-time. It also provides a user-friendly interface to view temperature readings and can be useful for monitoring system health and preventing overheating issues.

Note: This DOES NOT WORK if you are SSH'ed to the system.

Screenshot from 2021-08-18 21-29-36.png

 

How to install psensor

Ubuntu

sudo apt install psensor

CentOS (CentOS calls this package sensors)

sudo yum install xsensors

Example installation in Ubuntu 20.04

root@rdlab:/home/exx# apt install psensor
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  eatmydata libeatmydata1 libnetplan0 python3-importlib-metadata python3-jinja2 python3-json-pointer python3-jsonpatch python3-jsonschema python3-more-itertools
  python3-pyrsistent python3-zipp
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libxnvctrl0 psensor-common
The following NEW packages will be installed:
  libxnvctrl0 psensor psensor-common
0 upgraded, 3 newly installed, 0 to remove and 64 not upgraded.
Need to get 110 kB of archives.
After this operation, 660 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 libxnvctrl0 amd64 470.57.01-0ubuntu0.20.04.1 [11.1 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 psensor-common all 1.1.5-1.1ubuntu1 [40.4 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 psensor amd64 1.1.5-1.1ubuntu1 [58.8 kB]
Fetched 110 kB in 0s (267 kB/s)
Selecting previously unselected package libxnvctrl0:amd64.
(Reading database ... 191259 files and directories currently installed.)
Preparing to unpack .../libxnvctrl0_470.57.01-0ubuntu0.20.04.1_amd64.deb ...
Unpacking libxnvctrl0:amd64 (470.57.01-0ubuntu0.20.04.1) ...
Selecting previously unselected package psensor-common.
Preparing to unpack .../psensor-common_1.1.5-1.1ubuntu1_all.deb ...
Unpacking psensor-common (1.1.5-1.1ubuntu1) ...
Selecting previously unselected package psensor.
Preparing to unpack .../psensor_1.1.5-1.1ubuntu1_amd64.deb ...
Unpacking psensor (1.1.5-1.1ubuntu1) ...
Setting up libxnvctrl0:amd64 (470.57.01-0ubuntu0.20.04.1) ...
Setting up psensor-common (1.1.5-1.1ubuntu1) ...
Setting up psensor (1.1.5-1.1ubuntu1) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for libglib2.0-0:amd64 (2.64.6-1~ubuntu20.04.3) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...

How to run psensor

Make sure you run this with GUI. If your Linux OS is text-mode only, or if you are SSH'ing into the system, then it will give you an error.

Ubuntu

sudo psensor

CentOS

sudo xsensor

Example of running psensor correctly with GUI

All you need to do is open a terminal and use the command 'psensor'. On a fresh install, the default background color for the graph is yellow. Since the CPU temperature we wanted to monitor was also represented by a 'yellow' line, we changed the background color (not the foreground) to 'black', as shown below. Additionally, it's worth mentioning that the graph initially tries to appear on the left-hand side, but the sensors default to the same side as well. Resizing the screen or minimizing and maximizing the window will correct this issue

Screenshot from 2021-08-18 21-25-03.pngScreenshot from 2021-08-18 21-25-34.pngScreenshot from 2021-08-18 21-25-58.pngScreenshot from 2021-08-18 21-26-48.pngScreenshot from 2021-08-18 21-29-36.png

 

Example of error when running it via SSH'ing into system

root@rdlab:/home/exx# psensor
MoTTY X11 proxy: Unsupported authorisation protocol
Unable to init server: Could not connect: Connection refused

(psensor:9093): Gtk-WARNING **: 22:18:51.081: cannot open display: localhost:11.0

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.