Sunday 13 April 2014

glances - a simple but cool monitoring tool







I always am on the lookout for tools to help with monitoring a diagnosing issues. The best tools I find are those that quickly show you the information you need to know in an easy to read manner. I just discovered the excellent tool glances which is a a cross-platform curses-based monitoring tool. It shows a lot of useful information but in a manner that is easy to read. It can even be used in client/server mode!

Information shown includes :

  • Disk Usage per mount point
  • Disk I/O
  • Network Rx/s + Tx/s
  • Memory Usage
  • CPU Usage
  • Process
  • Uptime
I really like that it has color codes for state :

  • Green : OK
  • Blue : Careful
  • Magenta : Warning
  • Red : Critical

Installation



Arch Linux

  • From standard Arch or Raspberry Pi based ARM :

$ pacman -S glances

Ubuntu (13.04+)

  • From standard apt-get :

$sudo apt-get -y install glances


Debian/Ubuntu (pre 13.04)

  •  From python's 'pip'

$ sudo apt-get install python-pip python-dev
$ sudo pip install glances

CentOS/Red Hat

  • Configure the EPEL repository
  • Then install via yum

# yum -y install glances


Refresh Time

  • The default is 3 seconds but this can easily be changed e.g.
$ glances -t 10

Interactive Commands


  • a : Sort process list automatically
  • b : Switch between bit/s or Byte/s for network I/O
  • c : Sort processes by CPU usage
  • d : Show/hide disk I/O stats
  • f : Show/hide file system stats
  • h : Show/hide the help screen
  • i : Sort processes by I/O rate
  • l : Show/hide log messages
  • m : Sort processes by MEM usage
  • n : Show/hide network stats
  • p : Sort processes by name
  • q : Quit
  • s : Show/hide sensors stats (only available with -e flag)
  • t : View network I/O as combination
  • u : View cumulative network I/O
  • w : Delete finished warning log messages
  • x : Delete finished warning and critical log messages
  • y : Show/hide hddtemp stats (only available with -y flag)
  • 1 : Switch between global CPU and per-CPU stats
     

 Client/Server mode


  • In the server :

$ glances -s
Glances server is running on 0.0.0.0:61209


  • On Client
 $ glances -c @server

  • The footer will display the connection information e.g. Connected to @pi is shown below


No comments:

Post a Comment