Ubuntu

How to Install and Use Glances to Monitor the Ubuntu 22.04 System

Glances is a Python-based, open-source, cross-platform system monitoring program that runs on curses. It is a real-time monitoring tool to check system components including CPU, memory, network interface load, disk I/O, etc. Glances also support the cross-platform monitoring and are accessible through a web-based interface. This guide explains how to install and use Glances to monitor in Ubuntu.

How to Install and Use Glances to Monitor the Ubuntu 22.04 System

First, update and upgrade your Ubuntu system through the following commands:

sudo apt update
sudo apt upgrade -y

Usually, Ubuntu 22.04 comes with the Glances as the default package. This means that you can install it using the following command:

sudo apt install glances -y

Now, run the following command to enable and start the Glances:

sudo systemctl enable glances
sudo systemctl start glances

You can also check the status of the currently running Glances through the following command:

sudo systemctl status glances

As the previous image shows, the system displays “Active” for Glances. If you want to check the version of Glances, run the following command:

glances --version

If the previous commands do not enable the Glances, you can run the following command to enable it immediately:

sudo systemctl enable glances --now

You can run the following command to start the Glances from the terminal:

glances

Next, you can open the Glances through the timer which might aid the systems during demanding jobs. The timer is set at 1 by default, but you can alter it. For instance:

glances -t 4

Instead of the default time delay being 1 second, it is now 4 seconds.

Alerts in Glances

Glances have the color for alerts. Here is a list of colors with their details:

Colors Description
Green OK (Good)
Blue CAREFUL (Attention)
Violet WARNING (Alert)
Red SEVERE (Critical)

The default settings’ thresholds are as follows:

Warning Details
Careful 50
Warning 70
Critical 90

You can alter the setup from the default by editing the following:

nano /etc/glances/glances.conf

Now, add or edit the following lines in the files:

When you’re done, save and close the file. If you want to know more about Glances, run the following-given command:

glances -h

How to Run the Glances in a Web Browser

Glance also supports the web interface which you can run the following command:

glances -w

When you enter this command, the terminal displays “Glances Web User Interface started on http://0.0.0.0:61208.” Using the server’s IP address may make this perplexing.

You can use the following command to keep Glances running in the background for your primary client:

glances -w &

To end all active glances sessions, type the following to finish the processors in the background mode:

sudo killall glances

Conclusion

The Glances is one of the more prevalent alternatives for straightforward server monitoring due to the added benefit of remote monitoring. With an ongoing, active development, things keep becoming better. This is how you can easily install and use Glances in Ubuntu to monitor everything without effort.

About the author

Prateek Jangid

A passionate Linux user for personal and professional reasons, always exploring what is new in the world of Linux and sharing with my readers.