How to Install and Use Glances on RHEL 9/8, Rocky Linux, & CentOS Stream

Glances is a powerful, cross-platform system monitoring tool written in Python that gives you a comprehensive, real-time view of your server’s resources. It packs a massive amount of informationโ€”from CPU and memory usage to disk I/O, running processes, and network trafficโ€”into a single, easy-to-read console or web-based interface.

This guide provides clear, updated instructions for installing Glances on modern Red Hat Enterprise Linux (RHEL) systems (versions 9 and 8) and their compatible distributions, such as Rocky Linux, AlmaLinux, and CentOS Stream.


Why Use Glances?

Before diving into the installation, let’s consider why Glances is a favorite among system administrators:

  • All-in-One Dashboard: See all critical metrics in one place, eliminating the need to run multiple commands like top, htop, iostat, and nethogs.
  • Color-Coded Alerts: Glances uses colors to highlight potential issues, making it easy to spot system bottlenecks at a glance.
  • Remote Monitoring: Use the built-in web UI to monitor servers remotely from any browser.
  • Extensible: Glances can be extended with plugins to monitor Docker containers, specific applications, and more.

Method 1: Installing Glances with DNF (Recommended)

The most reliable and straightforward method for installing Glances is by using the Extra Packages for Enterprise Linux (EPEL) repository. This ensures you get a stable version that is well-integrated with your operating system.

Step 1: Enable the EPEL Repository

If you haven’t already enabled it, the EPEL repository gives you access to a large collection of high-quality open-source packages.

On RHEL 9, Rocky Linux 9, AlmaLinux 9:

sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm -y

On RHEL 8, Rocky Linux 8, AlmaLinux 8:

sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm -y

Step 2: Install Glances

With EPEL enabled, you can now install Glances with a single command. The dnf package manager will handle all necessary dependencies automatically.

sudo dnf install glances -y


Method 2: Installing Glances with Pip

If you need the absolute latest version of Glances or prefer to manage it as a Python package, you can use pip.

Step 1: Install Python and Pip

First, ensure you have Python and the pip package installer available.

sudo dnf install python3 python3-pip -y

Step 2: Install Glances using Pip

Now, install Glances. It’s also recommended to install the bottle package, which is required for the web interface.

sudo pip3 install glances bottle


Starting and Using Glances

Once installed, using Glances is simple.

Local Monitoring

To monitor the server you are currently logged into, just run the command:

glances

Press q or Esc to exit.

Remote Monitoring (Web Interface)

One of the best features of Glances is its built-in web server.

  1. Start the Web Server: Use the -w flag to start Glances in web server mode. The & at the end runs the process in the background.Bashglances -w &
  2. Open Firewall Port: You must allow traffic through the server’s firewall on the default port, 61208.Bashsudo firewall-cmd --add-port=61208/tcp --permanent sudo firewall-cmd --reload
  3. Access in Your Browser: You can now access the Glances dashboard from any other computer by navigating to: http://<your_server_ip>:61208

A Note on Outdated Distributions (RHEL 7/6/5)

The installation methods for RHEL versions 7, 6, 5, and their CentOS equivalents are no longer recommended as these operating systems are End-of-Life (EOL). Running EOL systems exposes you to unpatched security vulnerabilities. We strongly advise migrating to a supported version like RHEL 9 or Rocky Linux 9.


Troubleshooting

  • “Command not found” error: If you installed with pip, the executable might not be in your system’s PATH. A reboot or logging out and back in usually resolves this. If not, you may need to add ~/.local/bin to your PATH.
  • Web interface not accessible:
    • Double-check that you have opened port 61208 in your firewall settings.
    • Verify the Glances web server is running with ps aux | grep glances.
    • Ensure you are using http:// and not https:// in the browser URL.

Elsewhere On TurboGeek:  Control Your Atlas Data: Connect MongoDB with MongoSH Fast

Richard.Bailey

Richard Bailey, a seasoned tech enthusiast, combines a passion for innovation with a knack for simplifying complex concepts. With over a decade in the industry, he's pioneered transformative solutions, blending creativity with technical prowess. An avid writer, Richard's articles resonate with readers, offering insightful perspectives that bridge the gap between technology and everyday life. His commitment to excellence and tireless pursuit of knowledge continues to inspire and shape the tech landscape.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

Translate ยป