Glances: installing and tuning default thresholds on RedHat ES6

Glances is a free (under LGPL license) tool, written by Nicolas HENNION (aka Nicolargo) in Python and using libstatgrab to monitor your system.

I like the concept and it’s very easy to install and to handle.

I used to work a lot with top and sar on linux but now if I have the opportunity to install Glances, I do it.

Conceptually Glances is more like nmon on AIX, or glance on HP-UX (quite the same name, what a coincidence?).


Download Glances (1.3.7 on this post) :

Compile glance (you will need gcc) :

# tar ztf glances-1.3.7.tar.gz
# cd glances-1.3.7/
# ./configure
# make
# make install

Then install libstatgrab and pystatgrab librairies.

# rpm -Uvh libstatgrab-0.15-1.el6.rf.x86_64.rpm
# rpm -Uvh pystatgrab-0.5-9.el6.x86_64.rpm

You will not found the 2 rpm on RH ES6 CDs but you can find them on for instance.

Don’t try to install pystatgrab from the sources: it won’t work as it uses pkg-config and pkg-config is not able to locate the libs on RedHat (don’t now why?).

Run Glances:


Glances: installing and tuning

From the screenshot one can see that the server’s main statistics are available on one screen:

Cpu, load, Memory, Network, Disk I/O, Disk space, and process

For the monitoring part you have colors for current thresholds overflow and an history of the last 3 to 10 warning and critical alerts.

For more information see the man page or Nicolargo’s web site (in French):

nicolargo Glances doc

If you want to change the default limits, you will have to edit

# locate
# vi /usr/local/bin/

Find glancesLimits class :

class glancesLimits():
Manage the limit OK,CAREFUL,WARNING,CRITICAL for each stats
# The limit list is stored in an hash table:
#  limits_list[STAT] = [ CAREFUL , WARNING , CRITICAL ]
# Exemple:
#  limits_list['STD'] = [ 50, 70 , 90 ]
__limits_list = {   #           CAREFUL WARNING CRITICAL
'STD':  [50,    70,     90],
'LOAD': [0.7,   1.0,    5.0]

And modify the default limits, for instance:

__limits_list = {   #           CAREFUL WARNING CRITICAL
'STD':  [40,    50,     70],
'LOAD': [0.2,   0.5,    1.0]

Glances: tuning default thresholds

Now you can see that while cpu% user if still lower than 90, the color is now red, meaning CRITICAL and the process who were in CAREFUL state before (<70) are now in WARNING state. Same comment on the load.

AIX (5.3) NFS tuning

For an AIX migration I needed to maximize my transfer rate on a NFS share (AIX iSCSI is not working with QNAP Turbo NAS).

An AIX expert (one of the name you can read on IBM Redbooks covers) gave a tuning advice:

Pour un migration AIX j’avais besoin de maximiser les taux de transfert vers un partage NFS (comme le iSCSI AIX ne fonctionne pas avec les Turbo NAS QNAP).

Un export AIX (un de ceux qu’on peut lire sur la couverture des Redbook IBM) m’a donné un conseil de tuning assez simple à mettre en place:

To display the current network and nfs settings :

Pour afficher les valeurs actuelles des settings réseau et nfs :

nfso -a
no -a

Set the new parameters:

Mettre en place les paramètres suivants :

nfso -o nfs_use_reserved_ports=1
no -o rfc1323=1
no -o udp_recvspace=262144
nfso -o nfs_v3_pdts=8

(this tuning will be effective only on the next nfs mount)

(ce tuning  ne sera effectif qu’au prochain montage nfs)

then mount your share  :

ensuite, montez vos partages :

mount -o vers=3 qnap1:/Public /mnt

Be sure to run enable rfc1323 before incresing the tcp and udp receiving buffers (tcp_recvspace and udp_recvspace).

Il faut impérativement activer rfc1323 avant d’augmenter les buffers de reception tcp et udp.