Hello, friends. In this post, you will learn how to install Glances on Debian 11.
According to the tool’s website
Glances is a cross-platform system monitoring tool written in Python.
It allows real-time monitoring of various aspects of your system such as CPU, memory, disk, network usage etc. It also allows monitoring of running processes, logged-in users, temperatures, voltages, fan speeds etc.
Furthermore, it has a web interface that you can serve on your server and access from your mobile or computers. Although its dependencies are few, it really can be extensible with others like Docker (monitoring containers) or hddtemp (hard disk temperature).
Therefore, it is considered as a flexible and functional tool for many cases.
Installing Glances on Debian 11
The process is effortless, but we have to use PIP and install the Python dependencies to achieve the goal.
Installing Glances Dependencies
First, open a terminal and update the system completely
sudo apt update
sudo apt upgrade
Now install the core dependencies for Glances.
sudo apt install python3 python3-dev python3-jinja2 python3-psutil python3-setuptools hddtemp python3-pip lm-sensors
Note that this command also installs PIP, the Python package manager. This last one we will have to use to get Glances.
Before, update it together with psutil
to avoid problems.
pip3 install --upgrade pip
pip3 install --upgrade psutil
Now check the version you have
pip3 --version
Sample output.
pip 23.1.2 from /home/angelo/.local/lib/python3.9/site-packages/pip (python 3.9)
Install Glances
Now with PIP ready, you can install Glances by running
pip3 install glances[all]
Now it’s time to test it.
Using Glances on Linux
To use Glances we have three simple options. The first one is to do it in standalone mode. That is to say, to execute it on the system where it is installed and already.
To achieve this, you can run
glances
In this way, you can quickly have a screen on the terminal where the tool will run and thus monitor the system.
However, a very interesting and useful option is to run Glances in web mode. This way, you can access the monitoring using any device with an internet connection.
To do this, run
glances -w
This will make it available from port 61208
which you will have to open in the firewall, obviously. So, you can access it from http://server:61208
Finally, you can run Glances under the client-server architecture to make it accessible from nodes within the network.
In summary, on the client you have to install everything related to Glances as in the previous steps.
Then, on the server, you have to start Glances in server mode
glances -s
And now on the client you can run
glances -c [ip]
This method is useful to monitor several computers at the same time.
Conclusion
Glances is a great monitoring tool that has a lot of potential. Knowing how to install it and play with its modes can be important for many things.