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 colours that can show alerts to systems resources bottlenecks, system resources issues and much more. Glances, by default, comes with a pre-set list of colours, but you can modify and add additional configs.
Example of terminal layout of Glances in action.
The guide below will outline how to install Glances System Monitor for Ubuntu-based systems.
Table of Contents
The following system requirements will need to be met before installing Glances System Monitor.
- python>=2.7 or python>=3.4
- psutil>=5.3.0 (better with latest version)
You will need root access or sudo privileges to complete the installation.
First, make sure your system is up to date by typing the following command.
sudo apt update && sudo apt upgrade
Install Glances System Monitor by using the apt command from Ubuntu’s default repository.
sudo apt install glances
If you have Python-PIP3 installed, you can install via PIP.
sudo pip3 install glances
For older versions, you can install the PPA:arnaud-hartmann. This is not recommended for most installs.
sudo apt-add-repository ppa:arnaud-hartmann/glances-stable
How To Use
Once you have installed the program, to bring it up, all you need to do is type the following terminal command.
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
As mentioned at the start of the guide, Glances has the colour 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, and you will start to see all the settings you can change.
The following list commands you can use 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)
Run Glances In Web Browser
You can monitor Glances in your favourite web browser. All dependencies are installed as default. 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 actually using the servers 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.
Run 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 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
Comments and Conclusion
Glances System Monitor is a step above the default “top” package for monitoring system resources and processors that ships with default Ubuntu installations. This package is ideal, especially if you want a better overview of your system. It covers much more information and presents it in colour codes to signal information on 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.