How to configure the Glances Monitoring Tools on Oracle Linux 9.3

To Configure Glances Monitoring Tool On Oracle Linux 9.3

Introduction:

Glances is a versatile monitoring tool designed to display a wide range of system information through either a command-line or web-based interface. It offers insights on memory, CPU usage, disk input/output, file system status, uptime, running processes, network interfaces, alerts, and various other system metrics.

Procedure Steps:

Step 1: Check the OS version by using the below command.
[root@linuxhelp ~]# cat /etc/os-release
NAME="Oracle Linux Server"
VERSION="9.3"
ID="ol"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="9.3"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Oracle Linux Server 9.3"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:oracle:linux:9:3:server"
HOME_URL="https://linux.oracle.com/"
BUG_REPORT_URL="https://github.com/oracle/oracle-linux"
ORACLE_BUGZILLA_PRODUCT="Oracle Linux 9"
ORACLE_BUGZILLA_PRODUCT_VERSION=9.3
ORACLE_SUPPORT_PRODUCT="Oracle Linux"
ORACLE_SUPPORT_PRODUCT_VERSION=9.3

Step 2: Enable the EPEL Repository by using the below command.

 [root@linuxhelp ~]# dnf install epel-release
Oracle Linux 9 BaseOS Latest (x86_64)                                                                                    13 kB/s | 3.6 kB     00:00    
Oracle Linux 9 BaseOS Latest (x86_64)                                                                                    18 MB/s |  27 MB     00:01    
Oracle Linux 9 Application Stream Packages (x86_64)                                                                      33 kB/s | 3.9 kB     00:00    
Oracle Linux 9 Application Stream Packages (x86_64)                                                                      23 MB/s |  35 MB     00:01    
Oracle Linux 9 UEK Release 7 (x86_64)                                                                                    24 kB/s | 3.0 kB     00:00    
Oracle Linux 9 UEK Release 7 (x86_64)                                                                                    23 MB/s |  34 MB     00:01    
Last metadata expiration check: 0:00:07 ago on Friday 07 June 2024 12:01:57 AM.
Dependencies resolved.
========================================================================================================================================================
 Package                                    Architecture              Version                                Repository                            Size
========================================================================================================================================================
Installing:
 oracle-epel-release-el9                    x86_64                    1.0-1.el9                              ol9_baseos_latest                     14 k
Installing dependencies:
 yum-utils                                  noarch                    4.3.0-11.0.1.el9_3                     ol9_baseos_latest                     53 k
Transaction Summary
========================================================================================================================================================
Install  2 Packages
Total download size: 67 k
Installed size: 41 k
Is this ok [y/N]: y
Downloading Packages:
(1/2): oracle-epel-release-el9-1.0-1.el9.x86_64.rpm                                                                      74 kB/s |  14 kB     00:00    
(2/2): yum-utils-4.3.0-11.0.1.el9_3.noarch.rpm                                                                          250 kB/s |  53 kB     00:00    
--------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                   297 kB/s |  67 kB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                1/1 
  Installing       : yum-utils-4.3.0-11.0.1.el9_3.noarch                                                                                            1/2 
  Installing       : oracle-epel-release-el9-1.0-1.el9.x86_64                                                                                       2/2 
  Running scriptlet: oracle-epel-release-el9-1.0-1.el9.x86_64                                                                                       2/2 
  Verifying        : oracle-epel-release-el9-1.0-1.el9.x86_64                                                                                       1/2 
  Verifying        : yum-utils-4.3.0-11.0.1.el9_3.noarch                                                                                            2/2 
Installed:
  oracle-epel-release-el9-1.0-1.el9.x86_64                                      yum-utils-4.3.0-11.0.1.el9_3.noarch                                     

Complete!

Step 3: Install required packages by using the below command.

[root@linuxhelp ~]# dnf install python3 python3-jinja2 python3-psutil python3-setuptools hddtemp python3-pip lm_sensors
Last metadata expiration check: 0:00:51 ago on Friday 07 June 2024 12:02:34 AM.
Package python3-3.9.18-1.el9_3.x86_64 is already installed.
Package python3-psutil-5.8.0-12.0.1.el9.x86_64 is already installed.
Package python3-setuptools-53.0.0-12.el9.noarch is already installed.
Dependencies resolved.
========================================================================================================================================================
 Package                                      Architecture             Version                               Repository                            Size
========================================================================================================================================================
Installing:
 hddtemp                                      x86_64                   0.3-0.50.beta15.el9                   ol9_developer_EPEL                    82 k
 lm_sensors                                   x86_64                   3.6.0-10.el9                          ol9_appstream                        176 k
 python3-jinja2                               noarch                   2.11.3-5.el9                          ol9_appstream                        328 k
 python3-pip                                  noarch                   21.2.3-8.el9                          ol9_appstream                        2.9 M
Upgrading:
 python-unversioned-command                   noarch                   3.9.18-3.el9                          ol9_appstream                        8.3 k
 python3                                      x86_64                   3.9.18-3.el9                          ol9_baseos_latest                     30 k
 python3-libs                                 x86_64                   3.9.18-3.el9                          ol9_baseos_latest                    9.6 M
Installing dependencies:
 python3-babel                                noarch                   2.9.1-2.el9                           ol9_appstream                        6.6 M
 python3-markupsafe                           x86_64                   1.1.1-12.el9                          ol9_appstream                         52 k
 python3-pytz                                 noarch                   2021.1-5.el9                          ol9_appstream                         73 k
Transaction Summary
========================================================================================================================================================
Install  7 Packages
Upgrade  3 Packages
Total download size: 20 M
Is this ok [y/N]: y
Downloading Packages:
(1/10): hddtemp-0.3-0.50.beta15.el9.x86_64.rpm                                                                          354 kB/s |  82 kB     00:00    
(2/10): lm_sensors-3.6.0-10.el9.x86_64.rpm                                                                              750 kB/s | 176 kB     00:00    
(3/10): python3-markupsafe-1.1.1-12.el9.x86_64.rpm                                                                      2.0 MB/s |  52 kB     00:00    
(4/10): python3-jinja2-2.11.3-5.el9.noarch.rpm                                                                          5.0 MB/s | 328 kB     00:00    
(5/10): python3-pytz-2021.1-5.el9.noarch.rpm                                                                            2.3 MB/s |  73 kB     00:00    
(6/10): python3-3.9.18-3.el9.x86_64.rpm                                                                                 511 kB/s |  30 kB     00:00    
(7/10): python3-pip-21.2.3-8.el9.noarch.rpm                                                                              10 MB/s | 2.9 MB     00:00    
(8/10): python-unversioned-command-3.9.18-3.el9.noarch.rpm                                                              651 kB/s | 8.3 kB     00:00    
(9/10): python3-babel-2.9.1-2.el9.noarch.rpm                                                                             11 MB/s | 6.6 MB     00:00    
(10/10): python3-libs-3.9.18-3.el9.x86_64.rpm                                                                            17 MB/s | 9.6 MB     00:00    
--------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                    20 MB/s |  20 MB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                1/1 
  Upgrading        : python3-libs-3.9.18-3.el9.x86_64                                                                                              1/13 
  Upgrading        : python-unversioned-command-3.9.18-3.el9.noarch                                                                                2/13 
  Upgrading        : python3-3.9.18-3.el9.x86_64                                                                                                   3/13 
  Installing       : python3-markupsafe-1.1.1-12.el9.x86_64                                                                                        4/13 
  Installing       : python3-pytz-2021.1-5.el9.noarch                                                                                              5/13 
  Installing       : python3-babel-2.9.1-2.el9.noarch                                                                                              6/13 
  Installing       : python3-jinja2-2.11.3-5.el9.noarch                                                                                            7/13 
  Installing       : python3-pip-21.2.3-8.el9.noarch                                                                                               8/13 
  Installing       : lm_sensors-3.6.0-10.el9.x86_64                                                                                                9/13 
  Running scriptlet: lm_sensors-3.6.0-10.el9.x86_64                                                                                                9/13 
Created symlink /etc/systemd/system/multi-user.target.wants/lm_sensors.service → /usr/lib/systemd/system/lm_sensors.service.
 Installing       : hddtemp-0.3-0.50.beta15.el9.x86_64                                                                                           10/13 
  Running scriptlet: hddtemp-0.3-0.50.beta15.el9.x86_64                                                                                           10/13 
  Cleanup          : python3-3.9.18-1.el9_3.x86_64                                                                                                11/13 
  Cleanup          : python-unversioned-command-3.9.18-1.el9_3.noarch                                                                             12/13 
  Cleanup          : python3-libs-3.9.18-1.el9_3.x86_64                                                                                           13/13 
  Running scriptlet: python3-libs-3.9.18-1.el9_3.x86_64                                                                                           13/13 
  Verifying        : hddtemp-0.3-0.50.beta15.el9.x86_64                                                                                            1/13 
  Verifying        : lm_sensors-3.6.0-10.el9.x86_64                                                                                                2/13 
  Verifying        : python3-babel-2.9.1-2.el9.noarch                                                                                              3/13 
  Verifying        : python3-jinja2-2.11.3-5.el9.noarch                                                                                            4/13 
  Verifying        : python3-markupsafe-1.1.1-12.el9.x86_64                                                                                        5/13 
  Verifying        : python3-pip-21.2.3-8.el9.noarch                                                                                               6/13 
  Verifying        : python3-pytz-2021.1-5.el9.noarch                                                                                              7/13 
  Verifying        : python3-3.9.18-3.el9.x86_64                                                                                                   8/13 
  Verifying        : python3-3.9.18-1.el9_3.x86_64                                                                                                 9/13 
  Verifying        : python3-libs-3.9.18-3.el9.x86_64                                                                                             10/13 
  Verifying        : python3-libs-3.9.18-1.el9_3.x86_64                                                                                           11/13 
  Verifying        : python-unversioned-command-3.9.18-3.el9.noarch                                                                               12/13 
  Verifying        : python-unversioned-command-3.9.18-1.el9_3.noarch                                                                             13/13 
Upgraded:
  python-unversioned-command-3.9.18-3.el9.noarch               python3-3.9.18-3.el9.x86_64               python3-libs-3.9.18-3.el9.x86_64              
Installed:
  hddtemp-0.3-0.50.beta15.el9.x86_64        lm_sensors-3.6.0-10.el9.x86_64     python3-babel-2.9.1-2.el9.noarch    python3-jinja2-2.11.3-5.el9.noarch   
  python3-markupsafe-1.1.1-12.el9.x86_64    python3-pip-21.2.3-8.el9.noarch    python3-pytz-2021.1-5.el9.noarch   
Complete!

Step 4:- Install Glances by using the below command

[root@linuxhelp ~]# dnf install glances -y
Last metadata expiration check: 0:01:32 ago on Friday 07 June 2024 12:02:34 AM.
Dependencies resolved.
========================================================================================================================================================
 Package                                 Architecture                Version                              Repository                               Size
========================================================================================================================================================
Installing:
 glances                                 noarch                      3.3.1-2.el9                          ol9_developer_EPEL                      996 k
Installing dependencies:
 double-conversion                       x86_64                      3.1.5-6.el9                          ol9_appstream                            53 k
 python3-bottle                          noarch                      0.12.21-2.el9                        ol9_developer_EPEL                      106 k
 python3-defusedxml                      noarch                      0.7.1-3.el9                          ol9_developer_EPEL                       93 k
 python3-future                          noarch                      0.18.3-3.el9                         ol9_developer_EPEL                      1.3 M
 python3-ujson                           x86_64                      5.8.0-1.el9                          ol9_developer_EPEL                       41 k
Transaction Summary
========================================================================================================================================================
Install  6 Packages
Total download size: 2.6 M
Installed size: 6.5 M
Downloading Packages:
(1/6): glances-3.3.1-2.el9.noarch.rpm                                                                                   252 kB/s | 996 kB     00:03    
(2/6): python3-future-0.18.3-3.el9.noarch.rpm                                                                           5.5 MB/s | 1.3 MB     00:00    
(3/6): python3-ujson-5.8.0-1.el9.x86_64.rpm                                                                             703 kB/s |  41 kB     00:00    
(4/6): double-conversion-3.1.5-6.el9.x86_64.rpm                                                                         1.0 MB/s |  53 kB     00:00    
(5/6): python3-bottle-0.12.21-2.el9.noarch.rpm                                                                           22 kB/s | 106 kB     00:04    
(6/6): python3-defusedxml-0.7.1-3.el9.noarch.rpm                                                                         15 kB/s |  93 kB     00:06    
--------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                   418 kB/s | 2.6 MB     00:06     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                1/1 
  Installing       : double-conversion-3.1.5-6.el9.x86_64                                                                                           1/6 
  Installing       : python3-ujson-5.8.0-1.el9.x86_64                                                                                               2/6 
  Installing       : python3-future-0.18.3-3.el9.noarch                                                                                             3/6 
  Installing       : python3-defusedxml-0.7.1-3.el9.noarch                                                                                          4/6 
  Installing       : python3-bottle-0.12.21-2.el9.noarch                                                                                            5/6 
  Installing       : glances-3.3.1-2.el9.noarch                                                                                                     6/6 
  Running scriptlet: glances-3.3.1-2.el9.noarch                                                                                                     6/6 
  Verifying        : glances-3.3.1-2.el9.noarch                                                                                                     1/6 
  Verifying        : python3-bottle-0.12.21-2.el9.noarch                                                                                            2/6 
  Verifying        : python3-defusedxml-0.7.1-3.el9.noarch                                                                                          3/6 
  Verifying        : python3-future-0.18.3-3.el9.noarch                                                                                             4/6 
  Verifying        : python3-ujson-5.8.0-1.el9.x86_64                                                                                               5/6 
  Verifying        : double-conversion-3.1.5-6.el9.x86_64                                                                                           6/6 
Installed:
  double-conversion-3.1.5-6.el9.x86_64  glances-3.3.1-2.el9.noarch        python3-bottle-0.12.21-2.el9.noarch  python3-defusedxml-0.7.1-3.el9.noarch 
  python3-future-0.18.3-3.el9.noarch    python3-ujson-5.8.0-1.el9.x86_64 
Complete!

Step 5:- Add a firewall rule for Glances web port so that the web console would be accessible.

[root@linuxhelp ~]# firewall-cmd --zone=public --add-port=61208/tcp --permanent
success
[root@linuxhelp ~]# firewall-cmd --reload
Success

Step 6: Run the below glances command to monitor your local machine.

[root@linuxhelp ~]# glances

Step 7: 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, we need to install the Bottle module -- you can install this module  using pip command.
[root@linuxhelp ~]# pip3 install bottle
Requirement already satisfied: bottle in /usr/lib/python3.9/site-packages (0.12.21)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

Step 8: Run the below command to remotely monitor a machine [root@linuxhelp ~]# glances -w Glances Web User Interface started on http://0.0.0.0:61208/

Conclusion:

We have reached the end of this article. In this guide, we have walked you through the steps required to install Glances Monitoring Tool on Oracle Linux 9.3. Your feedback is much welcome.

FAQ
Q
What is Glances?
A
Glances is a cross-platform system monitoring tool that provides a comprehensive overview of your system's performance, including CPU, memory, disk I/O, network traffic, and more. It can be used in both standalone mode and client/server mode.
Q
How do I access Glances remotely?
A
To access Glances remotely, start it in web server mode using glances -w. Then, open a web browser and navigate to http://:61208.
Q
How do I configure Glances?
A
Glances can be configured by editing the glances.conf file. The configuration file location varies by system, but you can typically find it in /etc/glances/, $HOME/.config/glances/, or by using the --config option to specify a custom path.
Q
Can I install Glances using Docker?
A
Yes, you can run Glances in a Docker container. Use the following command to pull and run the Docker image:
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:ro -v /glances/conf:/glances/conf -p 61208-61209:61208-61209 nicolargo/glances
Q
How do I install Glances on macOS?
A
To install Glances on macOS, you can use Homebrew:
brew install glances