Home » How to Install Glances on AlmaLinux 8

How to Install Glances on AlmaLinux 8

by tuanlp

Glances is a cross-platform monitoring tool that aims to present a large amount of monitoring information through a curses or Web-based interface.

Features

  • CPU related information such as idle, iowait, usage, and more
  • Memory-related information such as usage, free, SWAP, and more.
  • Network usage information based on interfaces.
  • Disk usage information.
  • Lists processes resources used (sortable by resources).

Update the System.

yum update

Enable the EPEL Repository,

yum install epel-release

Output:

[root@vps ~]# yum install epel-release
Last metadata expiration check: 1:34:47 ago on Saturday 28 August 2021 01:14:12 PM EDT.
Dependencies resolved.
===============================================================
 Package           Arch        Version       Repository   Size
===============================================================
Installing:
 epel-release      noarch      8-11.el8      extras       24 k

Install required packages.

yum install python3 python3-jinja2 python3-psutil python3-setuptools hddtemp python3-pip lm_sensors

And check again if there are any updates available.

yum update

Install Glances

yum install glances

Output:

[root@vps ~]# yum install glances
Extra Packages for Enterprise Linux Mod 593 kB/s | 931 kB     00:01    
Extra Packages for Enterprise Linux 8 -  15 MB/s |  10 MB     00:00    
Dependencies resolved.
========================================================================
 Package              Architecture Version             Repository  Size
========================================================================
Installing:
 glances              noarch       3.1.4.1-7.el8       epel       1.3 M

Add a firewall rule so that the web console would be accessible,

firewall-cmd --zone=public --add-port=61208/tcp --permanent
firewall-cmd --reload    

After installing Glances you can use this tool in 2 modes.

  • Standalone – To monitor a single system and view results in the terminal.
  • Web – To monitor a single system and view results in web UI.

Run Glances in Standalone Mode

If you want to monitor your local machine, open a console/terminal and simply run:

glances

You will see the output something like below:

images

Run Glances in Web Mode

If you want to remotely monitor your machine, from any device with a web browser, just run the glances with the -w option:

For this to work, you need to install the Bottle module — you can install this module using pip

Note: For Python3 you need to use pip3 command to work.

pip3 install bottle

and then run the following command to remotely monitor a machine,

glances -w

Output:

[root@vps ~]# glances -w
Glances Web User Interface started on http://0.0.0.0:61208/

Now open the web browser using IP or FQDN on port 61208.

Web mode will only be active if the above command is running. You can quit the web mode by stopping the web mode with Ctrl + C.

images

Done.

You may also like