Glances (All in One Place) – Advanced Real Time System Performance Monitoring Tool for Linux

Glances is a cross-platform curses-based system monitoring tool written in Python.

It uses the psutil library to retrieve information from your system.

It’s accommodating all in one place, It shows a maximum information in a minimal space through curses or a web-based interface.

The information dynamically adapts depending on the size of the user interface.

This is a best alternative to top/htop utility on GNU/Linux.

Glances is capable to monitor CPU usage, Memory usage, Swap usage, System Load Average, Process list, Network interface, Disk I/O, Raid, Sensors (CPU temperature), Battery, Filesystem Usage, Docker, Monitor, Alert, System info, Uptime, etc.,.

It can also work in client/server mode. Remote monitoring could be done via terminal.

Alternatively, you can monitor system performance through the built-in web user interface, and through the mobile interface.

You can export all system statistics to CSV, StatsD, InfluxDB, ElasticSearch or even RabbitMQ.

Glances also provides a dedicated Grafana dashboard.

By default the view limitations are configured as follows (careful= 50, alert= 70 and critical= 90) and you can adjust according to your requirements. The glances configuration file is located in /etc/glances/glances.conf.

Glances Color Codes:

  • GREEN : Ok
  • BLUE : Careful
  • VIOLET : Warning
  • RED : Critical

Method-1: How to Install Glances on Linux Using the Glances Auto Installation Script

You can easily install the Glances using the Glances Auto Installation Script that supports all modern Linux distributions. This will automatically install all the dependencies required by the Glances. To do so, shoot the command below on your terminal.

Run the following command to install Glances using the curl command.

# curl -L https://bit.ly/glances | /bin/bash

Run the following command to install Glances using the wget command.

# wget -O- https://bit.ly/glances | /bin/bash

Method-2: How to Install Glances on Linux Using PIP Command

Glances is on PyPI, so you can easily install through pip. The pip package manager is a modern python module bundled with setuptools, it’s one of the recommended tool for installing Python packages in Linux.

Install Glances using pip.

# pip install glances

Install the following libraries in order to use optional features (like the Web interface, export module,ext):

# pip install glances[all]
or
# pip install 'glances[action,browser,cloud,cpuinfo,docker,export,folders,gpu,graph,ip,raid,snmp,web,wifi]'

Run the following commands to upgrade Glances and all its dependencies to the latest versions:

# pip install --upgrade glances
# pip install --upgrade psutil
# pip install --upgrade glances[all]

Method-3: How to Install the Glances on Linux From the Distribution Repository

Alternatively, using the Distribution Package Manager, you can install the Glances from the official repository on Linux distribution such as Debian, Ubuntu, Linux Mint, Fedora, Centos, Arch Linux, Manjaro and FreeBSD.

For Fedora system, use DNF Command to install glances.

$ sudo dnf install glances

For Debian/Ubuntu systems, use APT-GET Command or APT Command to install glances.

$ sudo apt install glances

For Arch Linux based systems, use Pacman Command to install glances.

$ sudo pacman -S glances

For RHEL/CentOS systems, use YUM Command to install glances.

$ sudo yum install glances

For openSUSE Leap system, use Zypper Command to install glances.

$ sudo zypper install glances

For FreeBSD

# pkg install py27-glances

How to Launch the Glances

Run the following command to launch the glances in a standalone mode.

# glances

For the Web server mode, run the below command and enter the URL http://:61208 or http://:61208 in your favorite web browser.

# glances -w &

For mobile interface.

Glances Options

Glances is offering several command line options, see the list below.

  • a Sort processes automatically
  • b Bytes or bits for network I/O
  • c Sort processes by CPU%
  • l Show/hide alert logs
  • m Sort processes by MEM%
  • w Delete warning alerts
  • u Sort processes by USER
  • x Delete warning and critical alerts
  • p Sort processes by name
  • 1 Global CPU or per-CPU stats
  • i Sort processes by I/O rate
  • I Show/hide IP module
  • t Sort processes by TIME
  • D Enable/disable Docker stats
  • d Show/hide disk I/O stats
  • T View network I/O as combination
  • f Show/hide filesystem stats
  • U View cumulative network I/O
  • n Show/hide network stats
  • F Show filesystem free space
  • s Show/hide sensors stats
  • g Generate graphs for current history
  • 2 Show/hide left sidebar
  • r Reset history
  • z Enable/disable processes stats
  • h Show/hide this help screen
  • 3 Enable/disable quick look plugin
  • B Count/rate for Disk I/O
  • e Enable/disable top extended stats
  • 5 Show/hide top menu (QL, CPU, MEM, SWAP and LOAD)
  • / Enable/disable short processes name
  • 0 Enable/disable Irix process CPU
  • q Quit (Esc and Ctrl-C also work)

Enjoy…)

About Magesh Maruthamuthu

Love to play with all Linux distribution

View all posts by Magesh Maruthamuthu

Leave a Reply

Your email address will not be published. Required fields are marked *