Glances is an open-source, cross-platform system monitoring tool written in Python that gathers CPU, memory, load, disk, file system, network, sensor, container and process metrics into a single, color-coded screen. In Linux monitoring, it occupies the space between interactive process viewers such as top and htop and full observability stacks, because the same program can run as a terminal dashboard, a web interface, a REST API server or a metrics exporter.
Glances collects most of its data through the psutil library, which reads the procfs and sysfs interfaces on Linux and equivalent system calls on other platforms. Its defining idea is density with prioritization: dozens of indicators fit on one screen, and threshold-based colors draw attention to the few that need action.
How Glances collects and displays metrics
Glances works as a modular collection of plugins, each responsible for one data source such as CPU, memory, network interfaces or Docker containers. On every refresh cycle, which defaults to about two seconds, each plugin samples its source, computes rates from counter differences and passes the result to the active output: curses terminal, web page or exporter.
The terminal interface uses the curses library and adapts its layout to the window width, hiding less important panels on narrow terminals. Keyboard shortcuts toggle panels and sort orders, for example c for CPU sorting, m for memory, d to hide disk I/O and 1 to switch between total and per-core CPU usage.
The following table summarizes the main plugin areas and the underlying Linux sources they rely on.
| Plugin area | Typical metrics | Linux source |
|---|---|---|
| CPU and load | User, system, iowait, steal, load averages | /proc/stat and /proc/loadavg |
| Memory and swap | Used, available, cached, swap in use | /proc/meminfo |
| Disk I/O | Read and write rates per device | /proc/diskstats |
| File systems | Used space per mount point | statvfs system call |
| Network | Receive and transmit rates per interface | /proc/net/dev |
| Sensors | Temperatures, fan speeds, battery | sysfs hwmon entries |
| Containers | CPU, memory and I/O per container | Docker or Podman API |
Alert thresholds and color coding in Glances
Glances classifies each value into four alert levels and colors it accordingly, which lets an operator spot trouble without reading numbers. The default percentage thresholds apply to CPU, memory, swap and file system usage and can be changed per plugin in the glances.conf file.
| Level | Default range | Color | Meaning |
|---|---|---|---|
| OK | Below 50% | Green | Normal operation |
| Careful | 50% to 70% | Blue | Worth watching |
| Warning | 70% to 90% | Magenta | Investigate soon |
| Critical | Above 90% | Red | Immediate attention |
When a warning or critical state lasts longer than a refresh cycle, Glances records it in an alert log at the bottom of the screen with start time, duration and peak value. Configured actions can run a shell command when a threshold is crossed, which turns the tool into a simple local alerting agent.
Glances operating modes
One installation of Glances can serve several different roles, selected with command-line options. This flexibility is the main reason administrators choose it over single-purpose tools.
| Mode | Command | Typical use |
|---|---|---|
| Standalone | glances | Interactive check on the local host |
| Web server | glances -w | Browser dashboard, default port 61208 |
| Client and server | glances -s and glances -c host | Terminal view of a remote host |
| REST API | glances -w --disable-webui | Metrics for scripts and integrations |
| Export | glances --export influxdb2 | Feeding a time-series database |
| One-shot output | glances --stdout cpu.user,mem.percent | Plain values for shell scripts |
Export modules cover CSV files, InfluxDB, Prometheus, Elasticsearch, MQTT and several other targets, so Glances can act as a lightweight collector feeding a Grafana dashboard. The web server and API have no authentication by default; a password option exists, and exposure beyond a trusted network should go through a reverse proxy with TLS.
How Glances compares with other Linux monitoring tools
Glances trades depth in any single area for breadth across the system. Specialized tools remain better for detailed diagnosis once Glances has shown where a problem lies.
| Tool | Focus | Strength relative to Glances |
|---|---|---|
| top and htop | Processes and CPU | Lower overhead, richer process control |
| btop | Interactive resource dashboard | Graphs and faster native rendering |
| atop and sar | Historical system activity | Recorded history for later analysis |
| iostat and vmstat | Disk and virtual memory statistics | Precise per-interval counters |
| Cockpit | Web-based server administration | Configuration tasks, not only metrics |
Because it runs on a Python interpreter, Glances consumes noticeably more CPU and memory than compiled tools such as htop or btop, typically a few percent of one core on a busy host with many processes. On small single-board computers or heavily loaded servers, this monitoring overhead can distort the very measurements being observed.
Practical configuration and common pitfalls
Effective use of Glances depends on tuning the configuration file and understanding what each number means. The most frequent issues are listed below.
- Missing panels usually mean an optional dependency is absent, for example the Docker library for containers or the web extras for
-w. - High iowait indicates CPU time spent waiting for storage, not CPU saturation, and should be confirmed with iostat or iotop.
- Memory percentage excludes reclaimable cache, so a high cached value alone is not a problem.
- Long refresh intervals smooth spikes; set
-t 1when chasing short bursts. - Container metrics require read access to the Docker or Podman socket, which grants broad privileges.
Disabling unused plugins in glances.conf or with --disable-plugin reduces both screen clutter and collection overhead, which matters most when Glances runs permanently as an exporter.
The idea in brief
Glances is like the dashboard of a car for a computer. Instead of separate gauges in separate places, it shows speed, fuel, temperature and warnings on one panel, and anything going wrong turns red.
It can run in a terminal window, in a web browser or quietly in the background sending numbers to another system. The key benefit is a quick overall health check before anyone starts deeper troubleshooting.
A practical scenario
A small company runs its file sharing and internal wiki on a single Debian server. Users complain that the wiki becomes sluggish every afternoon, but the administrator sees nothing unusual in a quick look at top.
The administrator starts glances -w as a systemd service bound to the internal network and enables the InfluxDB export feeding an existing Grafana instance. Over two days, the dashboards show that CPU usage stays below 30% while iowait rises above 40% around 3 p.m., and the alert log in Glances records a critical state for the data disk at the same times.
Further checks with iotop reveal that a scheduled backup job reads the entire share during working hours. Moving the backup to 11 p.m. removes the slowdown, and the persistent Glances exporter remains in place as an inexpensive early-warning system.