When working with Linux systems, it's important to have a convenient tool for monitoring system resources: CPU, memory, disk, network, and processes. The utility Glances is a powerful monitoring tool written in Python that displays real-time information in a convenient format and runs in the terminal. In this article, we'll look at how to install Glances on Debian and use it in practice.
Installing Glances
There are several ways to install Glances, but the most reliable on Debian is via `apt` or `pip`.
Option 1: Installing via APT
Option 2: Installing the latest version via pip
pip3 install glances
If you want to install system-wide, add --break-system-packages for newer versions of Debian:
Launching and Using
Just type:
You’ll see a statistics dashboard:
- CPU: per-core CPU usage
- Mem: RAM usage
- Swap: swap usage
- Disk I/O: disk activity
- Network: network traffic
- Processes: list of resource-consuming processes
Useful Key Bindings
Key | Action |
---|---|
q or Ctrl+C | Quit |
c | Sort processes by CPU |
m | Sort processes by memory |
d | Sort processes by I/O |
f | Search for a process |
l | Show/hide log file |
b | Enable/disable color highlight |
h | Show help |
Remote Monitoring
Glances can be used in client-server mode.
1. Start the server on a remote machine:
(default port is 61209)
2. Connect to it from another machine:
Extensions and Plugins
Glances can be integrated with:
- Web UI: running `glances -w` launches a web interface (available at http://localhost:61208)
- SNMP, Prometheus, InfluxDB, and more for metrics export
Example:
Conclusion
Glances is a convenient alternative to tools like htop, top, nmon, and even Grafana (when paired with Prometheus). It's suitable for both beginners and system administrators who need to quickly understand what's happening on the system.