Glances System Monitor is free, an open-source command-line tool for process monitoring, system resources such as CPU, Disk I/O, File System, Load Average, Memory, Network Interfaces and processes. Glances are built with Python language. Glances support cross-platform monitoring, which can be used in conjunction with a web-based interface.
One of the excellent features Glances supports is the ability to set thresholds in the program. You can set careful, warning, and critical in the configuration file, which will then relay information in colors that can show alerts to systems resources bottlenecks, system resources issues, and much more. Glances, by default, comes with a pre-set list of colors, but you can modify and add additional configs.
Example of terminal layout of Glances in action.
In the following tutorial, you will learn how to install and use Glances on Linux Mint 20.
Table of Contents
- 1 Prerequisites
- 2 Install Glances System Monitor
- 3 How to Use Glances System Monitor
- 4 Alerts in Glances System Monitor
- 5 Glances System Monitor Commands
- 6 How to Launch Glances In Web Browser
- 7 How to Launch Glances Client-Server Mode
- 8 How to Update Glances using PIP3
- 9 How to Remove (Uninstall) Glances System Monitor
- 10 Comments and Conclusion
- Recommended OS: Linux Mint 20 or higher.
- User account: A user account with sudo or root access.
Update Operating System
Update your Linux Mint operating system to make sure all existing packages are up to date:
sudo apt update && sudo apt upgrade -y
The tutorial will be using the sudo command and assuming you have sudo status. To verify sudo status on your account:
Example output showing sudo status:
[[email protected] ~]$ sudo whoami root
If you have not set up a sudo user account and would like to, visit our tutorial on How to Add a User to Sudoers on Linux Mint.
To use the root account, use the following command with the root password to log in.
Install Glances System Monitor
By default, Glances System Monitor is featured in the Ubuntu repositories, so it will naturally be available to Linux Mint. To install, use the following apt command:
sudo apt install glances
Verify the installation by checking the Glances build:
Glances v3.1.3 with psutil v5.5.1
How to Use Glances System Monitor
Once you have installed the program, you need to type the following terminal command to bring it up.
To exit the Glances program, you can use the following command.
You can change the time interval of Glance updating, the default is 1, but you can change this as an example:
glances -t 3
To bring up the help command, enter the following.
Alerts in Glances System Monitor
As mentioned at the start of the tutorial, Glances has the color for alerts. The following describes what they are.
- GREEN: OK (good)
- BLUE: CAREFUL (attention)
- VIOLET: WARNING (alert)
- RED: CRITICAL (critical)
The thresholds that default settings are as follows.
The default configuration can be changed. To do this, open up a text editor on the file /etc/glances/glances.conf. But firstly, let’s make a backup of the original configuration file for safekeeping.
sudo cp /etc/glances/glances.conf /etc/glances/glances-bkup.conf
Next, using the nano text editor, open up the main configuration file:
sudo nano /etc/glances/glances.conf
Scroll down (Line 37), and you will start to see all the settings you can change.
Adjust the numbers, then CTRL+O to save, then CTRL+X to exit. The defaults should be fine for most user setups; only edit if you strongly disagree with the values.
Glances System Monitor Commands
You can use the following list commands in Glances to configure, find, and show what you are looking for.
- a – Sort processes automatically
- c – Sort processes by CPU%
- m – Sort processes by MEM%
- p – Sort processes by name
- i – Sort processes by I/O rate
- d – Show/hide disk I/O stats ols
- f – Show/hide file system statshddtemp
- n – Show/hide network stats
- s – Show/hide sensors stats
- y – Show/hide hddtemp stats
- l – Show/hide logs
- b – Bytes or bits for network I/Oools
- w – Delete warning logs
- x – Delete warning and critical logs
- x – Delete warning and critical logs
- 1 – Global CPU or per-CPU stats
- h – Show/hide this help screen
- t – View network I/O as combination
- u – View cumulative network I/O
- q – Quit (Esc and Ctrl-C also work)
How to Launch Glances In Web Browser
You can monitor Glances in your favorite web browser. To initiate the browser function in the program, do the following.
Note that you will most likely see in the terminal display “Glances Web User Interface started on http://0.0.0.0:61208” when entering this command. This may look a little confusing, and it is using the server’s IP address.
You can set a password for the web-based monitor by typing the following command.
glances -w --password
To open the web browser for the program, enter your IP server address with the default port 61209 as an example.
For your primary client, you can keep glances running in the background with the following command.
glances -w &
The above creates a background running process. Now you must disown the current state.
If you need to kill the processors in background mode, type the following to kill all active glances sessions.
How to Launch Glances Client-Server Mode
Another great feature of the Glances program is that it provides client-server architecture. This means you can run glances on multiple remote servers and connect them to your primary client. All servers must have glances installed.
Login to a remote server, start the glance program in server-side mode.
After you have finished starting server-side monitoring on all the required servers you need, go to your client system and connect to the system’s IP address running the server-client mode with the following command.
glances -c server-IP-address
How to Update Glances using PIP3
Given Glances was installed using APT package manager, use the following command:
sudo apt update
If an update is available, use the apt upgrade command to update all packages or the package individually.
sudo apt upgrade glances
How to Remove (Uninstall) Glances System Monitor
If you no longer have need to have Glances on your Linux Mint operating system, to remove it in full, use the following command:
sudo apt autoremove glances --purge
Type “Y”, then press “ENTER KEY” to proceed with the uninstallation.
Comments and Conclusion
Glances System Monitor is a step above the default “top” package for monitoring system resources and processors. This package is ideal, especially if you want a better overview of your system. It covers much more information and presents it in color codes to signal what the data in front of you means and how it affects your server.
The extra benefit of remote monitoring makes this one of the more popular options for simple server monitoring. It continues to get better with an active development continuing to this day.