Glances: Installation and Usage Guide

Installation

Glances is a cross-platform monitoring tool which aims to present a large amount of monitoring information through a curses or Web-based interface. To install Glances, follow the instructions for your operating system.

On Linux

sudo apt update
sudo apt install glances

On macOS

brew install glances

On Windows

First, install Python. Then, open a command prompt and run:

pip install glances

Via Docker

docker pull nicolargo/glances
docker run -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host -it --rm --name glances nicolargo/glances

Basic Features

Once installed, you can start Glances by simply typing glances in your terminal. Here are some of the basic features you can use:

General Overview

When you start Glances, you will see a general overview of your system including CPU, Memory, Swap, Network, Disk I/O, and more.

Keyboard Shortcuts

Glances provides several keyboard shortcuts to navigate and control the display:

  • h – Show/hide the help screen
  • q – Quit
  • c – Sort processes by CPU usage
  • m – Sort processes by memory usage
  • d – Show/hide disk I/O stats
  • n – Show/hide network stats

Advanced Features

Glances also offers advanced features for more in-depth monitoring and management.

Web Interface

You can start Glances in web mode to access it via a web browser:

glances -w

By default, it will be accessible at http://localhost:61208.

Remote Monitoring

Glances can be configured for remote monitoring by starting it in server mode on the remote machine:

glances -s

Then, connect from the client machine:

glances -c <server-ip>

Alert Management

Glances can be configured to trigger alerts based on specific thresholds. To configure alerts, edit the glances.conf file, typically found in /etc/glances/ or ~/.config/glances/.

Exporting Data

Glances can export monitoring data to various formats and services, including CSV, InfluxDB, and more. Use the --export option to specify the export method:

glances --export csv

Plugins

Glances supports plugins for additional monitoring capabilities. You can enable plugins in the glances.conf file. For example, to enable the docker plugin:

[docker]
enable=true
Other Recent Posts