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
Prerequisites
- 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:
sudo whoami
Example output showing sudo status:
[joshua@linuxmint ~]$ 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.
su
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
Example output:
Verify the installation by checking the Glances build:
glances --version
Example output:
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.
glances
Example:
To exit the Glances program, you can use the following command.
Ctrl+C
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.
glances -h
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.
- careful=50
- warning=70
- critical=90
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.
Example:
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.
glances -w
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.
http://203.15.33.190:61209
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.
disown
If you need to kill the processors in background mode, type the following to kill all active glances sessions.
killall glances
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.
glances -s
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.
Example:
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
Example:
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.