Psensor – Monitor Linux Hardware Temperature [Motherboard and CPU]

Psensor is a GTK+ (Widget Toolkit for creating Graphical User Interface) based application software that is used to monitor hardware temperature and plot Real-Time graphs from the obtained data for quick review.

Psensor - Linux Hardware Temperature Monitoring
Psensor – Linux Hardware Temperature Monitoring

Features of Psensor

  • Show the temperature of the motherboard, CPU, GPU (Nvidia), and Hard Disk Drives.
  • Show CPU fan speed.
  • Psensor is capable of showing remote server temperature and fan speed.
  • Show Linux CPU usage, as well.
  • In fact, Psensor will detect any supported hardware and report the temperature as text and over a graph, automatically.
  • All the temperatures are plotted in one graph.
  • Alarms and Alerts ensure you don’t miss critical system hardware temperature and fan speed-related issues.
  • It is easy to configure and use.

Dependencies

  • lm-sensor and hddtemp – Psensor depends upon these two packages to get the reports about temperature and fan speed.
  • psensor-server – It is an optional package, which is required if you want to gather information about remote server temperature and fan speed.

Installation of Psensor in Linux

As I said above the Psensor program depends on lm-sensor and hddtemp packages and these two packages must be installed on the system in order to install Psensor.

Install lm-sensors in Linux

Most of the popular Linux distributions offer these two packages from the default repository, but on RHEL-based distributions, you need to install and enable epel-release repository to get these packages.

# yum install epel-release 
# yum install lm_sensors lm_sensors-devel hddtemp
Note: If you are using Fedora Linux, replace yum with dnf in the above command.

On Debian-based distributions, you can install from the default repository using the following apt command.

$ sudo apt install lm-sensors hddtemp

On Arch and OpenSuse, you can install it as shown.

$ sudo pacman -S lm-sensors hddtemp           [On Arch Linux]
$ sudo zypper install lm-sensors hddtemp      [On OpenSUSE]    

Install Psensor on Linux

Once these two dependencies are installed on the system, you can install Psensor on Debian-like systems, Arch, and OpenSuse using the following command.

$ sudo apt install psensor        [On Debian-based Systems]
$ sudo pacman -S psensor          [On Arch Linux]
$ sudo zypper install psensor     [On OpenSUSE]   

Unfortunately, on RedHat alike systems, Psensor isn’t available from the default system repository, and you need to compile it from the source as shown below.

# yum install gcc gtk3-devel GConf2-devel cppcheck libatasmart-devel libcurl-devel json-c-devel libmicrohttpd-devel help2man libnotify-devel libgtop2-devel make 

Next, download the most recent stable Psensor (i.e. version 1.2.1) source tarball and compile it using the following commands.

# wget https://wpitchoune.net/psensor/files/psensor-1.2.1.tar.gz 
# tar zxvf psensor-1.2.1.tar.gz 
# cd psensor-1.2.1/ 
# ./configure 
# make 
# make install

Install Psensor Server – optional, which is required only if you want to see the temperature and fan speed of the remote server.

# apt install psensor-server
Note: The Psensor Server package is only available under Debian alike systems, there aren’t any binary or source packages available for RedHat systems.

Psensor – Monitor Linux Hardware Temperature from CLI

It is an optional but suggestive step you should run sensors-detect as root to diagnose the hardware by sensors and type the default option 'Yes' until you know what you are doing.

# sensors-detect
Detect Hardware Sensors in Linux
Detect Hardware Sensors in Linux

Again optional step, but for the suggestive setup you should run sensors, as root to display the temperature of various hardware devices from the command line. All these data will be used for Psensor.

# sensors
Psensor - Monitor Linux Hardware Temperature
Psensor – Monitor Linux Hardware Temperature

Psensor – Monitor Linux Temperature from GUI

Run Psensor from the desktop Application Menu to get the graphical view.

Temperature Hardware Monitoring
Temperature Hardware Monitoring

Check mark all the Sensors to plot the graph. You may notice the color codes.

Plot Graphs of Hardware Temperature
Plot Graphs of Hardware Temperature

Psensor Customization in Linux

Go to Menu PsensorPreferencesInterface. From here, you can have options for Interface related customization, Temperature Unit, and Sensor Table Position.

Psensor Interface Customization
Psensor Interface Customization

Under Menu PsensorPreferencesStartup. From here, you can configure Launch/Hide at Startup and Restore Window Position and Size.

Control Psensor
Control Psensor

Under the Hood Graph (PsensorPreferencesGraph), you may configure Foreground/Background Color, Monitoring Duration, Update Interval, etc.

Psensor Graph Customization
Psensor Graph Customization

You may configure Sensors Settings under (PsensorPreferences → Sensors).

Sensors Settings
Sensors Settings

The last tab (PsensorPreferencesProviders) provides you with Enable/Disable configuration for all the sensors.

Psensor Configuration Control
Psensor Configuration Control

You may do sensor Preferences under (PsensorSensor Preferences).

Give Sensor Name
Give Sensor Name
Give Sensor Color
Give Sensor Color
Set Sensor Threshold
Set Sensor Threshold
Enable Sensor Indicator
Enable Sensor Indicator
Conclusion

Psensor is a very useful tool that lets you see those gray areas of system monitoring which is often overlooked i.e., Hardware temperature monitoring. Overheating, Hardware may damage that particular hardware, and other hardware in the surrounding or may crash the whole system.

No, I am not thinking from a financial perspective. Think of the value of Data that might loose and the cost and time it will take to build the system again. Hence it is always a good idea to have a tool like Psensor beside ourselves to avoid any such risk.

If you read this far, tweet to the author to show them you care. Tweet a thanks
Ravi Saive
I am an experienced GNU/Linux expert and a full-stack software developer with over a decade in the field of Linux and Open Source technologies

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

15 thoughts on “Psensor – Monitor Linux Hardware Temperature [Motherboard and CPU]”

  1. How do I get the graph to work? Tried all instructions but can not find the mentioned Application menu in Kbunutu. hddtemp doesn’t install so the Kbunutu 22.04 distro install doesn’t work.

    Reply
    • @Allewyn,

      I never used Kubuntu, but Psensor should work on Kubuntu as well, as it is based on Debian and Ubuntu. So, the psensor package should be available to install from the default repository…

      Reply
  2. I got this working today in Fedora 31, with a bit of effort. I had some false starts when I overlooked what turned out to be critical “warnings” in the configure script. Your instructions on which headers to install were helpful, but in order to compile it, I also had to tweak the sources that I obtained from https://wpitchoune.net/psensor/files/.

    The issue with the sources is a reference to “is_error“, a macro that can be found in old versions of the json-c library. Newer versions have dropped it, including apparently whichever version my compiler was pulling in.

    The latest official release of psensor was version 1.2.0, sometime in 2017. The code does still receive updates, including what appears to be a fix for the “is_error” issue, contributed a few months ago by Matheus Teixeira, then merged to master last month.

    My advice to anyone who is compiling this for RedHat/Fedora/etc.:

    1. Read the output of “./configure” carefully. There may be a warning that just says “psensors will not be built“.

    2. If you get complaints at compile-time, saying “undefined reference to `is_error’“, try cloning the psensor repo from gitlab and compiling this commit: abf3533d — it’s the one where the is_error fix is merged.

    Reply
  3. I’m really struggling with this. Linux newbie, wanting to troubleshoot unexplained shutdowns. Running Debian GNU/Linux 9 (stretch) 64-bit. Could find no clues in log files, so I figured monitoring CPU temp might help.

    Had to download/install compiler to get this far. Now I keep getting this error at the ‘# make’ step:

     In file included from ./hdd.h:23:0,
                     from hdd_hddtemp.c:37:
    ./psensor.h:22:29: fatal error: sensors/sensors.h: No such file or directory
     #include 
    

    What do I need to do?

    Reply
  4. I love psensor and use it on all of my computers, especially my 5 laptops. I would like to use the shutdown feature script but I havent been able to get it to work. If anyone has a script/template that I can use on my Linux machines, I’d be very grateful.

    I also need to know where the sensor log files are located and if I can move them to another location so that other Administrators can have access to them?

    Reply
  5. Thank you for the nice article. Is it possible to display an alert and shutdown the system when the temperature goes beyond certain predefined level?

    Synaptic package manager in Ubuntu contains psensor, psensor-common, psensor-server (version 1.1.3-2ubuntu3),

    hope i can mark and install with this version also.

    Reply
    • saw the alert facility, no idea about optimal threshold temperature in terms of value for various cores, cpu usage, free memory, hdd. thanks.

      Reply
  6. Very nice article that I used on my F23. However, please add a missing package in Step 2 for Fedora/Redhat/CentOS to include “yum install lm_sensors-devel” as the make command was complaining about a missing header file.

    Reply
    • @Naveej,

      Thanks for finding this article useful and also thanks for point out that missing dependency about lm_sensors-devel package, as per your suggestion, we’ve updated the article..

      Reply

Got something to say? Join the discussion.

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.