How nicolargo/glances works
Glances is a cross-platform system-monitoring tool. A user starts a standalone, client, server, or web mode; Glances gathers system and plugin statistics, then presents them in a terminal or web dashboard, exposes them through APIs, or exports them to files and external services. The graph preserves the documented monitoring, browsing, MCP, and export capabilities. Some subsystem wiring is documented in the README rather than visible in the sampled excerpts, so those relationships cite the README; unsampled implementation details are not assumed.
Main entry points: __init__.py Mode selection · client.py Remote client · stats.py Stats manager · model.py Plugin model
Components 21
Runtime and configuration
- Mode selection
glances/__init__.py - CLI and config
glances/main.py - Configuration
glances/config.py
System data collection
- Stats manager
glances/stats.py - Plugin model
glances/plugins/plugin/model.py - Process metrics
glances/processes.py - Container metrics
glances/plugins/containers/__init__.py - Application monitors
glances/amps/amp.py
Remote monitoring
- Server browser
glances/servers_list.py - Remote client
glances/client.py - XML-RPC server
glances/server.py - Web server
glances/webserver.py
User interfaces
- Standalone mode
glances/standalone.py - Terminal dashboard
glances/outputs/glances_curses.py - Web dashboard
glances/outputs/static/js/App.vue
APIs and exports
- REST API
glances/outputs/glances_restful_api.py - MCP service
glances/outputs/glances_mcp.py - Export framework
glances/exports/export.py - Export destinations
glances/exports
Other components
- Operator
- External services
Connections 25
- Operator → Mode selection: starts
- Mode selection → Standalone mode: selects mode
glances/__init__.py - Mode selection → Remote client: selects mode
glances/__init__.py - Mode selection → XML-RPC server: selects mode
glances/__init__.py - Mode selection → Web server: selects mode
glances/__init__.py - Mode selection → CLI and config: initializes
glances/__init__.py - CLI and config → Configuration: loads
glances/main.py - Standalone mode → Stats manager: collects stats
- Stats manager → Plugin model: uses plugins
glances/stats.py - Stats manager → Process metrics: tracks processes
glances/stats.py - Plugin model → Container metrics: collects containers
glances/plugins/containers/__init__.py - Plugin model → Application monitors: monitors apps
- Standalone mode → Terminal dashboard: renders
- Operator → Server browser: discovers servers
- Server browser → Remote client: connects to
glances/servers_list.py - Remote client → Terminal dashboard: renders
glances/client.py - XML-RPC server → Remote client: serves stats
- Web server → Web dashboard: serves dashboard
- Web server → REST API: exposes
- Operator → REST API: queries
- REST API → MCP service: provides MCP
glances/outputs/glances_restful_api.py - Remote client → Stats manager: updates
glances/client.py - Remote client → Export framework: exports stats
glances/client.py - Export framework → Export destinations: dispatches to
glances/exports/glances_timescaledb/__init__.py - Export destinations → External services: writes stats