This manual describes Glances version 1.7.
Copyright © 2012-2013 Nicolas Hennion <nicolas@nicolargo.com>
August 2013
Table of Contents
Glances is a cross-platform curses-based monitoring tool which aims to present a maximum of information in a minimum of space, ideally to fit in a classical 80x24 terminal or higher to have additional information.
Glances can adapt dynamically the displayed information depending on the terminal size. It can also work in a client/server mode for remote monitoring.
Glances is written in Python and uses the psutil library to get information from your system.
Console (80x24)
Full view (>80x24)
If you want to remotely monitor a machine, called server, from another one, called client, just run on the server:
server$ glances -s
and on the client:
client$ glances -c @server
where @server is the IP address or hostname of the server.
In server mode, you can set the bind address -B ADDRESS and listening TCP port -p PORT.
In client mode, you can set the TCP port of the server -p PORT.
Default binding address is 0.0.0.0 (Glances will listen on all the network interfaces) and TCP port is 61209.
In client/server mode, limits are set by the server side.
You can also set a password to access to the server -P password.
Glances is IPv6 compatible. Just use the -B :: option to bind to all IPv6 addresses.
-b | Display network rate in Byte per second (default: bit per second) |
-B IP | Bind server to the given IPv4/IPv6 address or hostname |
-c IP | Connect to a Glances server by IPv4/IPv6 address or hostname |
-C file | Path to the configuration file (default: {/usr/local,}/etc/glances/glances.conf) |
-d | Disable disk I/O module |
-e | Enable sensors module (requires pysensors, Linux-only) |
-f file | Set the HTML output folder or CSV file |
-h | Display the help and exit |
-m | Disable mount module |
-n | Disable network module |
-o output | Define additional output (available: HTML or CSV) |
-p PORT | Define the client/server TCP port (default: 61209) |
-P password | Define a client/server password |
-r | Disable process list (for low CPU consumption) |
-s | Run Glances in server mode |
-t seconds | Set refresh time in seconds (default: 3 sec) |
-v | Display the version and exit |
-y | Enable hddtemp module (requires hddtemp) |
-z | Do not use the bold color attribute |
-1 | Start Glances in per-CPU mode |
The following commands (key pressed) are supported while in Glances:
Sort process list automatically
No configuration file is mandatory to use Glances.
Furthermore a configuration file is needed for setup limits and/or monitored processes list.
By default, the configuration file is under:
/etc/glances/glances.conf (Linux)
or:
/usr/local/etc/glances/glances.conf (*BSD and OS X)
To override the default configuration, you can copy the glances.conf file to your $XDG_CONFIG_HOME directory (e.g. Linux):
mkdir -p $XDG_CONFIG_HOME/glances
cp /etc/glances/glances.conf $XDG_CONFIG_HOME/glances/
On OS X, you should copy the configuration file to ~/Library/Application Support/glances/.
The header shows the OS name, release version, platform architecture and the hostname. On Linux, it shows also the kernel version.
Short view:
If enough horizontal space is available, extended CPU informations are displayed.
Extended view:
To switch to per-CPU stats, just hit the 1 key:
The CPU stats are shown as a percentage and for the configured refresh time. The total CPU usage is displayed on the first line.
Note: limit values can be overwritten in the configuration file under the [cpu] section.
On the No Sheep blog, Zachary Tirrell defines the average load [1]:
"In short it is the average sum of the number of processes waiting in the run-queue plus the number currently executing over 1, 5, and 15 minute time periods."
Glances gets the number of CPU core to adapt the alerts. Alerts on average load are only set on 5 and 15 min. The first line also display the number of CPU core.
Note: limit values can be overwritten in the configuration file under the [load] section.
Glances uses two columns: one for the RAM and another one for the Swap.
If enough space is available, Glances displays extended informations:
With Glances, alerts are only set for on used memory and used swap.
Note: limit values can be overwritten in the configuration file under the [memory] and [swap] sections.
Glances displays the network interface bit rate. The unit is adapted dynamically (bits per second, kbits per second, Mbits per second, etc).
Alerts are only set if the network interface maximum speed is available.
For example, on a 100 Mbps ethernet interface, the warning status is set if the bit rate is higher than 70 Mbps.
Glances can displays the sensors informations trough lm-sensors (only available on Linux). As of lm-sensors, a filter is processed in order to display temperature only:
Glances can also grab hard disk temperature through the hddtemp daemon (see here [2] to install hddtemp on your system):
To enable the lm-sensors module:
$ glances -e
To enable the hddtemp module:
$ glances -y
There is no alert on this information.
Note: limit values can be overwritten in the configuration file under the [temperature] and [hddtemperature] sections.
Glances displays the disk I/O throughput. The unit is adapted dynamically.
Note: There is no alert on this information.
Glances displays the used and total file system disk space. The unit is adapted dynamically.
Alerts are set for used disk space:
Note: limit values can be overwritten in the configuration file under [filesystem] section.
Compact view:
Full view:
Three views are available for processes:
By default, or if you hit the a key, the processes list is automatically sorted by CPU of memory usage.
Note: limit values can be overwritten in the configuration file under the [process] section.
The number of processes in the list is adapted to the screen size.
Process status legend:
New in version 1.7. Optional.
The monitored processes list allows user, through the configuration file, to group processes and quickly show if the number of running process is not good.
Each item is defined by:
Up to 10 items can be defined.
For example, if you want to monitor the NGINX processes on a Web server, the following definition should do the job:
[monitor]
list_1_description=NGINX server
list_1_regex=.*nginx.*
list_1_command=nginx -v
list_1_countmin=1
list_1_countmax=4
If you also want to monitor the PHP-FPM daemon processes, you should add another item:
[monitor]
list_1_description=NGINX server
list_1_regex=.*nginx.*
list_1_command=nginx -v
list_1_countmin=1
list_1_countmax=4
list_1_description=PHP-FPM
list_1_regex=.*php-fpm.*
list_1_countmin=1
list_1_countmax=20
In the client/server mode, the list is define on the server side. A new method (getAllMonitored) is available in the API and get the JSON representation of the monitored processes list.
Alerts are set following:
A log messages list is displayed in the bottom of the screen if (and only if):
Each alert message displays the following information:
Glances uses a XML-RPC server and can be used by another client software.
API documentation is available at https://github.com/nicolargo/glances/wiki/The-Glances-API-How-To
To report a bug or a feature request use the bug tracking system at https://github.com/nicolargo/glances/issues
Feel free to contribute!
[1] | http://nosheep.net/story/defining-unix-load-average/ |
[2] | http://www.cyberciti.biz/tips/howto-monitor-hard-drive-temperature.html |
[3] | https://github.com/nicolargo/batinfo |