glances
System monitoring tool with web interface and REST API.
Official WebsiteFeatures
Installation
brew install glancesapt install glancespacman -S glancespip install glancesWhy Use glances?
Web Interface
Built-in Web UI for browser-based system monitoring. Perfect for remote server monitoring.
REST API
Retrieve system information via RESTful API. Easy integration with monitoring systems and dashboards.
Docker/Kubernetes Support
Features specialized for container environment monitoring. Monitor Docker, Podman, and Kubernetes containers.
Client/Server Mode
Monitor multiple remote servers from a single dashboard. Runs in server and client modes.
Installation
# pip (recommended)
pip install glances
# With all optional features
pip install 'glances[all]'
# With Web UI feature
pip install 'glances[web]'
# macOS (Homebrew)
brew install glances
# Ubuntu/Debian
sudo apt install glances
# Fedora
sudo dnf install glances
# Arch Linux
sudo pacman -S glances
# Docker
docker run -d --name=glances -p 61208:61208 -v /var/run/docker.sock:/var/run/docker.sock:ro nicolargo/glances:latest-fullBasic Usage
# Normal launch (TUI mode)
glances
# Launch in Web server mode
glances -w
# Launch Web server on specific port
glances -w -p 8080
# Launch in server mode (waiting for remote connections)
glances -s
# Connect to server in client mode
glances -c server_ip
# Specify update interval (seconds)
glances -t 5
# Export statistics to CSV
glances --export csv --export-csv-file /tmp/glances.csv
# Docker-only mode
glances --enable-plugin docker
# Batch mode (for scripts)
glances --stdout cpu.total,mem.percentScreen Display
Display Sections
Color Meanings
Keyboard Shortcuts
| Key | Function |
|---|---|
h | Show help screen |
q / Esc | Exit glances |
1 | Toggle global CPU stats and per-core |
2 | Toggle left sidebar |
3 | Toggle quick look |
/ | Filter processes |
a | Auto sort processes |
c | Sort by CPU% |
m | Sort by MEM% |
p | Sort by process name |
i | Sort by I/O rate |
t | Sort by CPU time |
d | Toggle disk I/O stats |
f | Toggle filesystem stats |
n | Toggle network stats |
s | Toggle sensor stats |
D | Toggle Docker stats |
k | Kill selected process |
e | Toggle extended process info |
w | Toggle warning logs |
Web Interface
One of glances' greatest features is browser-based monitoring via the built-in Web server.
# Launch in Web mode (default port: 61208)
glances -w
# Launch on custom port
glances -w -p 8080
# Enable authentication
glances -w --username admin --password secret
# Enable SSL
glances -w --ssl-cert cert.pem --ssl-key key.pem
# Access in Web mode
# Open http://localhost:61208 in browserWeb UI Features
- Responsive design viewable from smartphones
- Real-time updates (default 3-second interval)
- Dark theme support
- Interactive display of all statistics
REST API
glances provides a RESTful API to retrieve system information programmatically.
# API is also available when launching in Web mode
glances -w
# Get list of available plugins
curl http://localhost:61208/api/3/pluginslist
# Get CPU information
curl http://localhost:61208/api/3/cpu
# Get memory information
curl http://localhost:61208/api/3/mem
# Get process list
curl http://localhost:61208/api/3/processlist
# Get Docker container information
curl http://localhost:61208/api/3/docker
# Get all statistics
curl http://localhost:61208/api/3/all
# Get specific value
curl http://localhost:61208/api/3/cpu/totalClient/Server Mode
Monitor multiple servers from a single machine.
# Server side (monitored target)
glances -s
# Server side (with password)
glances -s --password
# Server side (bind to specific IP)
glances -s -B 0.0.0.0
# Client side (monitoring side)
glances -c 192.168.1.100
# Client side (with password)
glances -c 192.168.1.100 --password
# Monitor multiple servers (browser mode)
glances --browserSettings and Customization
Detailed customization is possible via config files.
# Configuration file location
~/.config/glances/glances.conf
# or
/etc/glances/glances.conf
# Generate default config
glances --config-file ~/.config/glances/glances.confConfiguration File Example
[global]
# Update interval (seconds)
refresh=3
# History length
history_size=1200
[cpu]
# CPU thresholds (warning color switching)
careful=50
warning=70
critical=90
[mem]
# Memory thresholds
careful=50
warning=70
critical=90
[network]
# Interfaces to monitor
hide=lo,docker.*
[diskio]
# Disks to monitor (regex)
hide=loop.*,/dev/dm-.*
[fs]
# Filesystems to monitor
hide=/boot.*,/snap.*
[docker]
# Docker container monitoring
disable=false
[processlist]
# Default process list sort
sort_key=cpu_percent
[amps]
# Application Monitoring Process
enable=true
[ports]
# Port monitoring
[[ports.port]]
host=localhost
port=80
description=HTTP
refresh=60Data Export
glances can export data in various formats.
# Export in CSV format
glances --export csv --export-csv-file /tmp/glances.csv
# Export to InfluxDB
glances --export influxdb
# Expose as Prometheus endpoint
glances --export prometheus
# Export to Elasticsearch
glances --export elasticsearch
# JSON for Grafana
glances --export json --export-json-file /tmp/glances.json
# Export to multiple destinations
glances --export influxdb,prometheusTips
1. Docker Monitoring Configuration
To monitor Docker, the glances user must be in the docker group or have read permissions on the socket. You can also mount the Docker socket with -v /var/run/docker.sock:/var/run/docker.sock:ro to monitor from within a container.
2. Grafana Integration
Export to InfluxDB and visualize in Grafana to display system history on beautiful dashboards. Official Grafana dashboard templates are available for glances.
3. AMPs (Application Monitoring Processes)
Use the AMPs feature for detailed monitoring of specific applications (nginx, mysql, postgres, etc.). Can be enabled in the config file.
4. Alert Configuration
Set thresholds for CPU, memory, and disk in the config file to display alerts at three levels: critical/warning/careful.
5. systemd Service
Register glances as a systemd service to automatically start in Web server mode on system boot. Combine with glances --export for continuous monitoring.
6. Script Integration
Use the --stdout option to output specific metrics to stdout. Useful for automation in shell scripts. Example: glances --stdout cpu.total,mem.percent