LinuxCommandLibrary

glances

Monitor system resources in real-time

TLDR

Run in terminal

$ glances
copy

Run in web server mode to show results in browser
$ glances [[-w|--webserver]]
copy

Run in server mode to allow connections from other Glances clients
$ glances [[-s|--server]]
copy

Connect to a Glances server
$ glances [[-c|--client]] [hostname]
copy

Require a password in (web) server mode
$ glances [[-s|--server]] --password
copy

Exit Glances
$ <q>
copy

Display help
$ glances [[-h|--help]]
copy

SYNOPSIS

glances [OPTIONS]
glances -s [OPTIONS] (Server mode)
glances -c @client_ip [OPTIONS] (Client mode)
glances -w [OPTIONS] (Web server mode)

PARAMETERS

-b, --byte
    Displays network I/O in bytes per second, rather than bits per second.

-c , --client
    Connects Glances to a remote Glances server. The client can be an IP address or a hostname.

-s, --server
    Runs Glances in server mode, allowing other Glances instances to connect and retrieve system information.

-w, --webserver
    Starts Glances with a built-in web server, allowing monitoring through a web browser.

-p , --port
    Specifies the listening port for server, client, or web server modes. Default is 61209.

-t , --time
    Sets the refresh time interval in seconds for updating the displayed information. Default is 2 seconds.

-1, --percpu
    Displays CPU statistics for each individual core, rather than aggregated CPU usage.

-C , --config
    Specifies an alternative configuration file to load instead of the default.

-P , --password
    Sets a password for client/server mode to secure remote connections.

--disable-process
    Disables the process monitoring module, useful for reducing resource usage or focusing on other metrics.

--export
    Exports stats to a specified output destination, e.g., influxdb, json, csv, prometheus.

-V, --version
    Displays the Glances version information and exits.

-h, --help
    Shows the help message and exits.

DESCRIPTION

Glances is a free, open-source, cross-platform system monitoring tool written in Python. It provides a real-time, comprehensive overview of system resources through a curses-based terminal interface. The information displayed dynamically adapts to the terminal size, ensuring optimal readability.

It monitors key metrics such as CPU usage, memory consumption, load average, disk I/O, network activity, process lists, file systems, sensors, Docker containers, system uptime, and more. Glances supports various operational modes, including standalone, client/server for remote monitoring, and a built-in web interface. Additionally, it offers robust data export capabilities to external services like InfluxDB, Prometheus, Graphite, and can output data in formats like CSV and JSON.

CAVEATS

Glances requires Python and the psutil library (and other optional libraries for specific features) to function. While comprehensive, its resource usage might be higher than lighter tools like top or htop due to its Python foundation and extensive feature set. When running in server or web server mode, it's crucial to implement proper security measures (e.g., firewalls, strong passwords) to prevent unauthorized access.

INTERACTIVE COMMANDS

Within the Glances TUI, users can press various keys for interactive control. For example, 'm' sorts processes by memory usage, 'p' by CPU usage, 'd' by disk I/O, 'f' by filesystem usage, 'l' toggles the process list, and 'q' quits the application.

CONFIGURATION

Glances is highly configurable through a configuration file, typically located at /etc/glances/glances.conf or ~/.config/glances/glances.conf. This file allows users to customize thresholds for alerts, define modules to enable/disable, and set other preferences.

HISTORY

Glances was created by Nicolas Hennion (nicolargo) and first released around 2011. It was developed to provide a more visually appealing and comprehensive system monitoring experience compared to traditional command-line tools. Leveraging Python and the psutil library, it achieved cross-platform compatibility from its early stages. Over the years, Glances has seen continuous development, expanding its feature set to include client/server modes, a web interface, and numerous data export options, establishing itself as a popular and versatile monitoring solution.

SEE ALSO

top(1), htop(1), nmon(1), iostat(1), netstat(8), free(1), vmstat(8)

Copied to clipboard