Glances

Software version1.6.1/Latest
Operating SystemDebian 7
WebsiteGlances Website
Last Update11/08/2013

Introduction

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

It avoids having to run several tools to get an all-in-one overview of your system. For example, when you want to quickly see what’s wrong on a system for diagnosis, you’ll need to launch top/htop, iostat, vmstat…Glances gives you a large overview of your system health. You can then investigate with the appropriate tool if you want. But you didn’t waste your time opening several tools to get the first desired information: where does the problem come from? So Glances answers that question.

Glances screenshot

Installation

Packages

The glances packages are not yet available in Debian wheezy packages. But they are in Jessie!

That’s why we can do APT pinning to use packages:

(/etc/apt/preferences)

  Package: *
Pin: release a=wheezy
Pin-priority: 900

Package: *
Pin: release a=jessie
Pin-priority: 100

Package: glances
Pin: release a=jessie
Pin-priority: 1001
  

Add as well the jessie repositories to your current wheezy:

(/etc/apt/sources.list)

  deb http://ftp.fr.debian.org/debian/ jessie main contrib non-free
deb-src http://ftp.fr.debian.org/debian/ jessie main contrib non-free
  

Now update and install glances:

  aptitude update
aptitude install glances
  

Pip

You can install the latest version of Glances using pip. First install dependencies:

  aptitude install python-pip python-dev
  

Then install Glances:

  pip install Glances
  

You’re now able to launch glances in command line:

  glances
  

Upgrade

To upgrade your Glances version:

  pip install --upgrade glances
  

Configuration

There is nothing especially to configure as default options could be enough for a large set of users. Anyway, you can add or change several options of the default configuration in /etc/glances.glances.conf.

An option that comes with 1.7 version is the possibility to watch a specific software. Let’s say Nginx for instance. You can ask glance to look at it by adding these lines:

(/etc/glances.glances.conf)

  [monitor]
list_1_description=Web Nginx Server
list_1_regex=.*nginx.*
list_1_command=nginx -v
list_1_countmin=1
list_1_countmax=4
  
  • list_X: replace X by 1 to 9, this is the information for additional software (here Nginx)
  • description: set the software description (16 chars max)
  • regex: regex to group software information
  • command: the command to run that will show information in glances
  • countmin: minimum number of information to show
  • countmax: maximum number of information to show

You can add other software by adding same lines with list_2, list_3…

Client/Server mode

There is also a client/server mode. You can run a server like this:

  glances -s
  

And you can connect clients:

  glances -c <server>
  

Replace by the server IP.

References

  1. https://github.com/nicolargo/glances

Last updated 11 Aug 2013, 19:26 CEST. history