glances/docs/glances-doc.rst

843 lines
23 KiB
ReStructuredText
Raw Normal View History

2013-04-08 18:16:00 +04:00
=======
Glances
=======
2015-01-22 23:52:15 +03:00
This manual describes *Glances* version 2.3.
2013-04-08 18:16:00 +04:00
2015-01-03 01:23:47 +03:00
Copyright © 2011-2015 Nicolas Hennion <nicolas@nicolargo.com>
2013-04-08 18:16:00 +04:00
2015-01-22 23:52:15 +03:00
January 2015
2013-04-08 18:16:00 +04:00
.. contents:: Table of Contents
Introduction
============
2014-06-08 22:44:49 +04:00
Glances is a cross-platform curses-based system 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. It can adapt dynamically the displayed information depending
on the terminal size.
2013-04-08 18:16:00 +04:00
2014-06-08 22:44:49 +04:00
Glances can also work in client/server mode. Remote monitoring could be
done via terminal or web interface.
2013-04-08 18:16:00 +04:00
2014-06-08 22:44:49 +04:00
Glances is written in Python and uses the `psutil`_ library to get
information from your system.
2013-04-08 18:16:00 +04:00
Console (80x24)
.. image:: images/screenshot.png
Full view (>80x24)
.. image:: images/screenshot-wide.png
2014-05-31 15:50:05 +04:00
Web interface (Firefox)
.. image:: images/screenshot-web.png
2013-04-08 18:16:00 +04:00
Usage
=====
2014-06-08 22:44:49 +04:00
Standalone Mode
2013-04-08 18:16:00 +04:00
---------------
Simply run:
.. code-block:: console
$ glances
2014-06-08 22:44:49 +04:00
Client/Server Mode
2013-04-08 18:16:00 +04:00
------------------
2014-06-08 22:44:49 +04:00
If you want to remotely monitor a machine, called ``server``, from
another one, called ``client``, just run on the server:
2013-04-08 18:16:00 +04:00
.. code-block:: console
server$ glances -s
and on the client:
.. code-block:: console
client$ glances -c @server
where ``@server`` is the IP address or hostname of the server.
2013-04-08 18:16:00 +04:00
2014-12-03 00:40:59 +03:00
Glances can centralize available Glances servers using the ``--browser`` option. The server list can be staticaly defined in the Glances configuration file (section [serverlist]). Glances can also detect and display all Glances servers available on you network (auto discover mode is based on the the Zeroconf protocol only available on GNU/Linux and Mac OS X):
2014-11-16 23:31:02 +03:00
.. code-block:: console
2014-11-29 12:17:39 +03:00
client$ glances --browser
It is possible to disable the auto discover mode ``--disable-autodiscover``.
2014-11-16 23:31:02 +03:00
2014-06-08 22:44:49 +04:00
In server mode, you can set the bind address ``-B ADDRESS`` and listening
TCP port ``-p PORT``.
2013-04-08 18:16:00 +04:00
In client mode, you can set the TCP port of the server ``-p PORT``.
2014-11-29 12:17:39 +03:00
You can set a password to access to the server ``--password``.
2014-05-31 15:50:05 +04:00
2014-06-08 22:44:49 +04:00
Default binding address is ``0.0.0.0`` (Glances will listen on all the
available network interfaces) and TCP port is ``61209``.
2013-04-08 18:16:00 +04:00
In client/server mode, limits are set by the server side.
2014-06-08 22:44:49 +04:00
Glances is ``IPv6`` compatible. Just use the ``-B ::`` option to bind to
all IPv6 addresses.
2013-08-02 20:13:38 +04:00
2014-06-08 22:44:49 +04:00
As an experimental feature, if Glances server is not detected by the
client, the latter will try to grab stats using the ``SNMP`` protocol:
2014-05-21 16:43:00 +04:00
.. code-block:: console
2014-06-08 22:44:49 +04:00
client$ glances -c @snmpserver
2014-05-21 16:43:00 +04:00
2014-11-29 12:17:39 +03:00
Note: Stats grabbed by SNMP request are limited (operating system dependent).
2014-05-31 15:50:05 +04:00
2014-06-08 22:44:49 +04:00
Web Server Mode
---------------
2014-05-31 15:50:05 +04:00
2014-06-08 22:44:49 +04:00
If you want to remotely monitor a machine, called ``server``, from any
2014-11-29 12:17:39 +03:00
device with a web browser, just run the server with the ``-w`` option:
2014-05-31 15:50:05 +04:00
.. code-block:: console
server$ glances -w
2014-06-08 22:44:49 +04:00
and on the client enter the following URL in your favorite web browser:
::
2014-05-31 15:50:05 +04:00
2014-06-08 22:44:49 +04:00
http://@server:61208
2014-05-31 15:50:05 +04:00
where ``@server`` is the IP address or hostname of the server.
2014-05-21 16:43:00 +04:00
To change the refresh rate of the page, just add the period in seconds between refreshes at the end of the URL, ie. to refresh every 10s, use ``http://@server:61208/10``.
2014-06-08 22:44:49 +04:00
The Glances web interface follows responsive web design principles.
Screenshot from Chrome on Android
.. image:: images/screenshot-web2.png
2013-04-08 18:16:00 +04:00
2013-08-02 20:13:38 +04:00
2014-06-08 22:44:49 +04:00
Command Reference
2013-04-08 18:16:00 +04:00
=================
2014-06-08 22:44:49 +04:00
Command-Line Options
2013-04-08 18:16:00 +04:00
--------------------
-h, --help show this help message and exit
-V, --version show program's version number and exit
-d, --debug Enable debug mode
-C CONF_FILE, --config CONF_FILE
path to the configuration file
--enable-history enable the history mode
--disable-bold disable bold mode in the terminal
--disable-diskio disable disk I/O module
--disable-fs disable filesystem module
--disable-network disable network module
--disable-sensors disable sensors module
--disable-left-sidebar
disable left sidebar
--disable-process disable process module
--disable-log disable log module
--enable-process-extended
enable extended stats on top process
2015-02-03 19:58:39 +03:00
--disable-quicklook disable the Quicklook module
2014-11-29 12:17:39 +03:00
--path-history PATH_HISTORY
Set the export path for graph history
--export-csv CSV_FILE
export stats to a CSV file
--export-influxdb
export stats to an InfluxDB server
2014-12-31 13:24:46 +03:00
--export-statsd
export stats to a Statsd server
-c CLIENT, --client CLIENT
connect to a Glances server by IPv4/IPv6 address or
hostname
-s, --server run Glances in server mode
2014-11-29 12:17:39 +03:00
--browser run the Glances client browser (list of Glances server)
--disable-autodiscover
disable autodiscover feature
-p PORT, --port PORT define the client/server TCP port [default: 61209]
-B BIND_ADDRESS, --bind BIND_ADDRESS
bind server to the given IPv4/IPv6 address or hostname
--password-badidea PASSWORD_ARG
define password from the command line
--password define a client/server password from the prompt or
file
2014-11-16 23:31:02 +03:00
--disable-autodiscover
Hide Glances server from the auto discover feature
--snmp-community SNMP_COMMUNITY
SNMP community
--snmp-port SNMP_PORT
SNMP port
--snmp-version SNMP_VERSION
SNMP version (1, 2c or 3)
--snmp-user SNMP_USER
SNMP username (only for SNMPv3)
--snmp-auth SNMP_AUTH
SNMP authentication key (only for SNMPv3)
--snmp-force force SNMP mode
-t TIME, --time TIME set refresh time in seconds [default: 3 sec]
-w, --webserver run Glances in web server mode
-f PROCESS_FILTER, --process-filter PROCESS_FILTER
set the process filter patern (regular expression)
--process-short-name force short name for processes name
2014-11-29 12:17:39 +03:00
--hide-kernel-threads
hide kernel threads in process list
--tree display processes as a tree
-b, --byte display network rate in byte per second
-1, --percpu start Glances in per CPU mode
--fs-free-space display FS free space instead of used
--theme-white optimize display for white background
2013-04-08 18:16:00 +04:00
2014-06-08 22:44:49 +04:00
Interactive Commands
2013-04-08 18:16:00 +04:00
--------------------
2013-07-25 16:50:51 +04:00
The following commands (key pressed) are supported while in Glances:
2013-04-08 18:16:00 +04:00
2014-09-13 17:29:07 +04:00
``ENTER``
Set the process filter
Filter is a regular expression pattern:
- gnome: all processes starting with the gnome string
- .*gnome.*: all processes containing the gnome string
2013-04-08 18:16:00 +04:00
``a``
Sort process list automatically
2013-04-08 18:16:00 +04:00
- If CPU iowait ``>60%``, sort processes by I/O read and write
2013-04-08 18:16:00 +04:00
- If CPU ``>70%``, sort processes by CPU usage
- If MEM ``>70%``, sort processes by memory usage
``b``
Switch between bit/s or Byte/s for network I/O
2013-04-08 18:16:00 +04:00
``c``
Sort processes by CPU usage
2013-04-08 18:16:00 +04:00
``d``
Show/hide disk I/O stats
``e``
Enable/disable top extended stats
2013-04-08 18:16:00 +04:00
``f``
Show/hide file system stats
``F``
Switch between FS used and free space
``g``
2015-01-01 21:40:08 +03:00
Generate graphs for current history
2013-04-08 18:16:00 +04:00
``h``
Show/hide the help screen
2013-04-08 18:16:00 +04:00
``i``
2014-06-08 22:44:49 +04:00
Sort processes by I/O rate
2013-04-08 18:16:00 +04:00
``l``
Show/hide log messages
``m``
Sort processes by MEM usage
2013-04-08 18:16:00 +04:00
``n``
Show/hide network stats
``p``
Sort processes by name
2014-11-16 23:31:02 +03:00
``q`` or ``ESC``
2015-01-01 21:40:08 +03:00
Quit the current Glances session
``r``
Reset history
2013-04-08 18:16:00 +04:00
``s``
2014-05-21 16:43:00 +04:00
Show/hide sensors stats
2013-04-08 18:16:00 +04:00
``t``
Sort process by CPU times (TIME+)
``T``
View network I/O as combination
2013-04-08 18:16:00 +04:00
``u``
View cumulative network I/O
2013-04-08 18:16:00 +04:00
``w``
Delete finished warning log messages
``x``
Delete finished warning and critical log messages
2014-03-19 01:27:57 +04:00
``z``
2014-06-08 22:44:49 +04:00
Show/hide processes stats
2013-04-08 18:16:00 +04:00
``1``
Switch between global CPU and per-CPU stats
``2``
Enable/disable left sidebar
2015-02-03 19:58:39 +03:00
``3``
Enable/disable the Quicklook module
``/``
Switch between short name / command line (processes name)
2013-04-08 18:16:00 +04:00
2014-11-29 12:17:39 +03:00
In the Glances client browser (accessible through the --browser command line argument):
2014-11-16 23:31:02 +03:00
``ENTER``
Run Glances client to the selected server
``UP``
Up in the servers list
``DOWN``
Down in the servers list
``q`` or ``ESC``
2015-01-01 21:40:08 +03:00
Quit Glances
2014-11-16 23:31:02 +03:00
2013-04-08 18:16:00 +04:00
Configuration
=============
2013-07-25 16:50:51 +04:00
No configuration file is mandatory to use Glances.
2013-04-08 18:16:00 +04:00
2014-06-08 22:44:49 +04:00
Furthermore a configuration file is needed to set up limits, disks or
network interfaces to hide and/or monitored processes list or to define
alias.
2013-04-08 18:16:00 +04:00
By default, the configuration file is under:
:Linux: ``/etc/glances/glances.conf``
:\*BSD and OS X: ``/usr/local/etc/glances/glances.conf``
:Windows: ``%APPDATA%\glances\glances.conf``
On Windows XP, the ``%APPDATA%`` path is:
2014-06-08 22:44:49 +04:00
::
2013-04-08 18:16:00 +04:00
C:\Documents and Settings\<User>\Application Data
2013-04-08 18:16:00 +04:00
Since Windows Vista and newer versions:
2013-04-08 18:16:00 +04:00
2014-06-08 22:44:49 +04:00
::
2013-04-08 18:16:00 +04:00
C:\Users\<User>\AppData\Roaming
or
%userprofile%\AppData\Roaming
2013-04-08 18:16:00 +04:00
You can override the default configuration, located in one of the above
directories on your system, except for Windows.
2014-06-08 22:44:49 +04:00
Just copy the ``glances.conf`` file to your ``$XDG_CONFIG_HOME`` directory,
e.g., on Linux:
2013-04-08 18:16:00 +04:00
.. code-block:: console
mkdir -p $XDG_CONFIG_HOME/glances
2014-06-08 22:44:49 +04:00
cp /usr/share/doc/glances/glances.conf $XDG_CONFIG_HOME/glances/
2013-04-08 18:16:00 +04:00
2014-06-08 22:44:49 +04:00
On OS X, you should copy the configuration file to
``~/Library/Application Support/glances/``.
2013-04-08 18:16:00 +04:00
*Configuration file description*
Each plugin and export module can have a section.
Example for the CPU plugin:
.. code-block::
[cpu]
user_careful=50
user_warning=70
user_critical=90
iowait_careful=50
iowait_warning=70
iowait_critical=90
system_careful=50
system_warning=70
system_critical=90
steal_careful=50
steal_warning=70
steal_critical=90
By default Steal CPU time alerts aren't logged. If you want to enable log/alert, just add:
.. code-block::
steal_log=True
Logs and debug mode
===================
2014-10-30 14:53:28 +03:00
Glances logs all its internal messages to a log file. By default, only
INFO & WARNING & ERROR &CRITICAL levels are logged, but DEBUG messages
can ben logged using the -d option on the command line.
2014-10-30 14:53:28 +03:00
By default, the log file is under:
2014-10-30 14:53:28 +03:00
:Linux, \*BSD and OS X: ``/tmp/glances.log``
:Windows: ``%APPDATA%\Local\temp\glances.log``
If glances.log is not writable, a new file will be created and returned to the user console.
2014-06-08 22:44:49 +04:00
Anatomy Of The Application
2013-04-08 18:16:00 +04:00
==========================
Legend
------
| ``GREEN`` stat counter is ``"OK"``
| ``BLUE`` stat counter is ``"CAREFUL"``
| ``MAGENTA`` stat counter is ``"WARNING"``
| ``RED`` stat counter is ``"CRITICAL"``
2014-06-08 22:44:49 +04:00
*Note*: only stats with colored background will be logged in the alert
view.
2014-05-31 15:50:05 +04:00
2013-04-08 18:16:00 +04:00
Header
------
.. image:: images/header.png
2014-06-08 22:44:49 +04:00
The header shows the hostname, OS name, release version, platform
architecture and system uptime (on the upper right corner).
Additionally, on GNU/Linux, it also shows the kernel version.
2014-05-21 16:43:00 +04:00
2014-06-08 22:44:49 +04:00
In client mode, the server connection status is displayed.
2014-05-31 15:50:05 +04:00
Connected:
.. image:: images/connected.png
Disconnected:
2014-05-31 15:50:05 +04:00
.. image:: images/disconnected.png
2013-04-08 18:16:00 +04:00
2015-02-03 20:01:52 +03:00
QUICKLOOK
---------
The quicklook plugin is only display on wide screen and propose a bar view for CPU and memory (virtual and swap).
.. image:: images/quicklook.png
*Note*: limit values can be overwritten in the configuration file under
the ``[quicklook]`` section.
2013-04-08 18:16:00 +04:00
CPU
---
Short view:
.. image:: images/cpu.png
2014-06-08 22:44:49 +04:00
If enough horizontal space is available, extended CPU information are
displayed.
2013-04-08 18:16:00 +04:00
Extended view:
.. image:: images/cpu-wide.png
To switch to per-CPU stats, just hit the ``1`` key:
.. image:: images/per-cpu.png
2014-06-08 22:44:49 +04:00
The CPU stats are shown as a percentage and for the configured refresh
time. The total CPU usage is displayed on the first line.
2013-04-08 18:16:00 +04:00
2014-06-08 22:44:49 +04:00
| If user|system CPU is ``<50%``, then status is set to ``"OK"``
| If user|system CPU is ``>50%``, then status is set to ``"CAREFUL"``
| If user|system CPU is ``>70%``, then status is set to ``"WARNING"``
| If user|system CPU is ``>90%``, then status is set to ``"CRITICAL"``
2013-04-08 18:16:00 +04:00
2014-06-08 22:44:49 +04:00
*Note*: limit values can be overwritten in the configuration file under
the ``[cpu]`` and/or ``[percpu]`` sections.
2013-08-02 20:13:38 +04:00
2013-04-08 18:16:00 +04:00
Load
----
.. image:: images/load.png
2014-06-08 22:44:49 +04:00
On the *No Sheep* blog, *Zachary Tirrell* defines the load average [1]_:
2013-04-08 18:16:00 +04:00
"In short it is the average sum of the number of processes
waiting in the run-queue plus the number currently executing
2014-05-21 16:43:00 +04:00
over 1, 5, and 15 minutes time periods."
2013-04-08 18:16:00 +04:00
Glances gets the number of CPU core to adapt the alerts.
2014-06-08 22:44:49 +04:00
Alerts on load average are only set on 15 minutes time period.
The first line also displays the number of CPU core.
2013-04-08 18:16:00 +04:00
2014-06-08 22:44:49 +04:00
| If load average is ``<0.7*core``, then status is set to ``"OK"``
| If load average is ``>0.7*core``, then status is set to ``"CAREFUL"``
| If load average is ``>1*core``, then status is set to ``"WARNING"``
| If load average is ``>5*core``, then status is set to ``"CRITICAL"``
2013-04-08 18:16:00 +04:00
2014-06-08 22:44:49 +04:00
*Note*: limit values can be overwritten in the configuration file under
the ``[load]`` section.
2013-08-02 20:13:38 +04:00
2013-04-08 18:16:00 +04:00
Memory
------
2014-06-08 22:44:49 +04:00
Glances uses two columns: one for the ``RAM`` and one for the ``SWAP``.
2013-04-08 18:16:00 +04:00
.. image:: images/mem.png
2014-06-08 22:44:49 +04:00
If enough space is available, Glances displays extended information for
the ``RAM``:
2013-04-08 18:16:00 +04:00
.. image:: images/mem-wide.png
2014-06-08 22:44:49 +04:00
Alerts are only set for used memory and used swap.
2013-04-08 18:16:00 +04:00
2014-06-08 22:44:49 +04:00
| If used memory|swap is ``<50%``, then status is set to ``"OK"``
| If used memory|swap is ``>50%``, then status is set to ``"CAREFUL"``
| If used memory|swap is ``>70%``, then status is set to ``"WARNING"``
| If used memory|swap is ``>90%``, then status is set to ``"CRITICAL"``
2013-04-08 18:16:00 +04:00
2014-06-08 22:44:49 +04:00
*Note*: limit values can be overwritten in the configuration file under
the ``[memory]`` and/or ``[memswap]`` sections.
2013-08-02 20:13:38 +04:00
2013-04-08 18:16:00 +04:00
Network
-------
.. image:: images/network.png
Glances displays the network interface bit rate. The unit is adapted
dynamically (bits per second, kbits per second, Mbits per second, etc).
2014-06-08 22:44:49 +04:00
Alerts are only set if the maximum speed per network interface is available
(see sample in the configuration file).
2013-04-08 18:16:00 +04:00
2014-06-08 22:44:49 +04:00
*Note*: it is possibile to define a list of network interfaces to hide
and per-interface limit values in the ``[network]`` section of the
2014-10-30 14:53:28 +03:00
configuration file and aliases for interface name.
2013-08-02 20:13:38 +04:00
2013-04-08 18:16:00 +04:00
Disk I/O
--------
.. image:: images/diskio.png
Glances displays the disk I/O throughput. The unit is adapted dynamically.
2014-06-08 22:44:49 +04:00
There is no alert on this information.
2013-04-08 18:16:00 +04:00
2014-06-08 22:44:49 +04:00
*Note*: it is possible to define a list of disks to hide under the
``[diskio]`` section in the configuration file and aliases for disk name.
2014-06-08 22:44:49 +04:00
File System
2013-04-08 18:16:00 +04:00
-----------
.. image:: images/fs.png
Glances displays the used and total file system disk space. The unit is
adapted dynamically.
2014-06-08 22:44:49 +04:00
Alerts are set for used disk space.
2013-04-08 18:16:00 +04:00
2014-06-08 22:44:49 +04:00
| If used disk is ``<50%``, then status is set to ``"OK"``
| If used disk is ``>50%``, then status is set to ``"CAREFUL"``
| If used disk is ``>70%``, then status is set to ``"WARNING"``
| If used disk is ``>90%``, then status is set to ``"CRITICAL"``
2013-04-08 18:16:00 +04:00
2014-06-08 22:44:49 +04:00
*Note*: limit values can be overwritten in the configuration file under
the ``[filesystem]`` section.
2013-08-02 20:13:38 +04:00
2015-01-31 15:45:48 +03:00
If a RAID controller is detected on you system, its status will be displayed:
.. image:: images/raid.png
2014-05-31 15:50:05 +04:00
Sensors
-------
2014-06-08 22:44:49 +04:00
Glances can displays the sensors information using `lm-sensors`,
`hddtemp` and `batinfo` [2]_.
2014-05-31 15:50:05 +04:00
2014-06-08 22:44:49 +04:00
All of the above libraries are available only on Linux.
2014-05-31 15:50:05 +04:00
2014-06-08 22:44:49 +04:00
As of lm-sensors, a filter is being applied in order to display
temperature only.
2013-04-08 18:16:00 +04:00
2014-06-08 22:44:49 +04:00
.. image:: images/sensors.png
2014-05-31 15:50:05 +04:00
There is no alert on this information.
2013-04-08 18:16:00 +04:00
2014-10-30 14:53:28 +03:00
*Note*: limit values and sensors alias names can be defined in the configuration
file under the ``[sensors]`` section.
2013-08-02 20:13:38 +04:00
2014-06-08 22:44:49 +04:00
Processes List
2013-04-08 18:16:00 +04:00
--------------
Compact view:
.. image:: images/processlist.png
Full view:
.. image:: images/processlist-wide.png
2013-08-02 20:13:38 +04:00
Three views are available for processes:
* Processes summary
2014-06-08 22:44:49 +04:00
* Optional monitored processes list (see below)
2013-08-02 20:13:38 +04:00
* Processes list
2013-04-08 18:16:00 +04:00
The processes summary line display:
* Tasks number (total number of processes)
* Threads number
* Running tasks number
* Sleeping tasks number
* Other tasks number (not running or sleeping)
2014-05-31 15:50:05 +04:00
* Sort key
2014-06-08 22:44:49 +04:00
By default, or if you hit the ``a`` key, the processes list is
automatically sorted by:
2013-04-08 18:16:00 +04:00
2014-06-08 22:44:49 +04:00
* ``CPU`` if there is no alert (default behavior)
* ``CPU`` if a CPU or LOAD alert is detected
* ``MEM`` if a memory alert is detected
* ``Disk I/O`` if a CPU iowait alert is detected
2013-08-02 20:13:38 +04:00
2013-04-08 18:16:00 +04:00
The number of processes in the list is adapted to the screen size.
``CPU%``
% of CPU used by the process
``MEM%``
% of MEM used by the process
2014-05-21 16:43:00 +04:00
``VIRT``
2014-06-14 14:44:24 +04:00
Total program size - Virtual Memory Size (VMS)
2014-05-21 16:43:00 +04:00
``RES``
2014-06-13 16:10:02 +04:00
Resident Set Size (RSS)
2013-04-08 18:16:00 +04:00
``PID``
Process ID
``USER``
2014-05-21 16:43:00 +04:00
User ID
2013-04-08 18:16:00 +04:00
``NI``
2014-06-08 22:44:49 +04:00
Nice level of the process (niceness other than 0 is highlighted)
2013-04-08 18:16:00 +04:00
``S``
2014-06-08 22:44:49 +04:00
Process status (running process is highlighted)
2013-04-08 18:16:00 +04:00
``TIME+``
Cumulative CPU time used
``IOR/s``
2014-06-08 22:44:49 +04:00
Per process I/O read rate (in Byte/s)
2013-04-08 18:16:00 +04:00
``IOW/s``
2014-06-08 22:44:49 +04:00
Per process I/O write rate (in Byte/s)
2014-05-21 16:43:00 +04:00
``COMMAND``
Process command line
2014-10-30 14:53:28 +03:00
User cans switch to the process name by pressing on the ``/`` key
2013-04-08 18:16:00 +04:00
Process status legend:
``R``
2014-05-21 16:43:00 +04:00
Running
2013-04-08 18:16:00 +04:00
``S``
2014-05-21 16:43:00 +04:00
Sleeping (may be interrupted)
2013-04-08 18:16:00 +04:00
``D``
2014-05-21 16:43:00 +04:00
Disk sleep (may not be interrupted)
2013-04-08 18:16:00 +04:00
``T``
2014-05-21 16:43:00 +04:00
Traced / Stopped
2013-04-08 18:16:00 +04:00
``Z``
2014-05-21 16:43:00 +04:00
Zombie
2013-04-08 18:16:00 +04:00
In standalone mode, additionals informations are provided for the top process:
2014-09-13 17:29:07 +04:00
.. image:: images/processlist-top.png
* CPU affinity (number of cores used by the process)
* Extended memory information (swap, shared, text, lib, data and dirty on Linux)
* Open threads, files and network sessions (TCP and UDP)
2015-01-01 21:40:08 +03:00
* IO nice level
The extended stats feature could be enabled using the --enable-process-extended option (command line) or the ``e`` key (curses interface).
2014-09-13 17:29:07 +04:00
2014-06-14 14:44:24 +04:00
*Note*: limit values can be overwritten in the configuration file under
2014-06-08 22:44:49 +04:00
the ``[process]`` section.
2013-08-02 20:22:32 +04:00
2014-06-08 22:44:49 +04:00
Monitored Processes List
2013-08-02 20:22:32 +04:00
------------------------
The monitored processes list allows user, through the configuration file,
2014-06-08 22:44:49 +04:00
to group processes and quickly show if the number of running processes is
not good.
2013-08-02 20:22:32 +04:00
.. image:: images/monitored.png
2013-08-02 20:22:32 +04:00
Each item is defined by:
* ``description``: description of the processes (max 16 chars).
* ``regex``: regular expression of the processes to monitor.
2014-06-08 22:44:49 +04:00
* ``command`` (optional): full path to shell command/script for extended
stat. Should return a single line string. Use with caution.
* ``countmin`` (optional): minimal number of processes. A warning will
be displayed if number of processes < count.
* ``countmax`` (optional): maximum number of processes. A warning will
be displayed if number of processes > count.
2013-08-02 20:13:38 +04:00
Up to 10 items can be defined.
2014-06-08 22:44:49 +04:00
For example, if you want to monitor the Nginx processes on a Web server,
the following definition should do the job:
2014-06-08 22:44:49 +04:00
::
2013-08-02 20:13:38 +04:00
[monitor]
list_1_description=Nginx server
2013-08-02 20:13:38 +04:00
list_1_regex=.*nginx.*
list_1_command=nginx -v
list_1_countmin=1
list_1_countmax=4
2014-06-08 22:44:49 +04:00
If you also want to monitor the PHP-FPM daemon processes, you should add
another item:
2014-06-08 22:44:49 +04:00
::
2013-08-02 20:13:38 +04:00
[monitor]
list_1_description=Nginx server
2013-08-02 20:13:38 +04:00
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 client/server mode, the list is defined on the server side.
2014-06-08 22:44:49 +04:00
A new method, called `getAllMonitored`, is available in the APIs and
get the JSON representation of the monitored processes list.
Alerts are set as following:
| If number of processes is 0, then status is set to ``"CRITICAL"``
| If number of processes is min < current < max, then status is set to ``"OK"``
| Else status is set to ``"WARNING"``
2013-04-08 18:16:00 +04:00
Logs
----
.. image:: images/logs.png
2014-06-08 22:44:49 +04:00
A log messages list is displayed in the bottom of the screen if (and
only if):
2013-04-08 18:16:00 +04:00
- at least one ``WARNING`` or ``CRITICAL`` alert was occurred
- space is available in the bottom of the console/terminal
Each alert message displays the following information:
2014-06-08 22:44:49 +04:00
1. start datetime
2. duration if alert is terminated or `ongoing` if the alert is still in
progress
2013-04-08 18:16:00 +04:00
3. alert name
2014-06-08 22:44:49 +04:00
4. {min,avg,max} values or number of running processes for monitored
processes list alerts
2013-04-08 18:16:00 +04:00
2015-01-04 22:59:04 +03:00
Docker
------
If you use Docker, Glances can help you to monitor your container. Glances uses the Docker API through the Docker-Py library.
.. image:: images/docker.png
2015-01-03 01:23:47 +03:00
Actions
-------
Glances can trigger actions on events.
By action, we mean all shell command line. For example, if you want to execute the foo.py script if the last 5 minutes load are critical then add the action line to the Glances configuration file:
2015-01-31 00:18:21 +03:00
.. code-block::
[load]
critical=5.0
critical_action=python /path/to/foo.py
2015-01-03 01:23:47 +03:00
2015-01-22 23:52:15 +03:00
All the stats are available in the command line through the use of the {{mustache}} syntax. Another example to create a log file containing used vs total disk space if a space trigger warning is reached:
2015-01-03 01:23:47 +03:00
2015-01-31 00:18:21 +03:00
.. code-block::
[fs]
warning=70
warning_action=echo {{mnt_point}} {{used}}/{{size}} > /tmp/fs.alert
2015-01-03 01:23:47 +03:00
2015-01-03 01:31:05 +03:00
*Note*: You can use all the stats for the current plugin (see https://github.com/nicolargo/glances/wiki/The-Glances-2.x-API-How-to for the stats list)
2015-01-03 01:23:47 +03:00
Gateway to others services
==========================
*CSV*
2013-04-08 18:16:00 +04:00
2014-05-21 16:43:00 +04:00
It is possible to export statistics to CSV file.
2013-04-08 18:16:00 +04:00
2013-12-30 19:45:45 +04:00
.. code-block:: console
2013-04-08 18:16:00 +04:00
$ glances --export-csv /tmp/glances.csv
CSV file description:
- Stats description (first line)
- Stats (others lines)
*InfluxDB*
2013-04-08 18:16:00 +04:00
2014-12-31 13:24:46 +03:00
You can export statistics to an InfluxDB server (time series server). The connection should be defined in the Glances configuration file as following:
2014-12-31 19:36:48 +03:00
.. code-block::
[influxdb]
host=localhost
port=8086
user=root
password=root
db=glances
and run Glances with:
.. code-block:: console
2013-04-08 18:16:00 +04:00
$ glances --export-influxdb
2013-12-30 19:45:45 +04:00
2014-12-31 13:24:46 +03:00
*Statsd*
You can export statistics to a Statsd server (welcome to Graphite !). The connection should be defined in the Glances configuration file as following:
2014-12-31 19:36:48 +03:00
.. code-block::
2014-12-31 13:24:46 +03:00
[statsd]
host=localhost
port=8125
prefix=glances
Note: the prefix option is optionnal ('glances by default')
and run Glances with:
.. code-block:: console
$ glances --export-statsd
Glances will generate stats as:
2014-12-31 19:36:48 +03:00
.. code-block::
2014-12-31 13:24:46 +03:00
'glances.cpu.user': 12.5,
'glances.cpu.total': 14.9,
'glances.load.cpucore': 4,
'glances.load.min1': 0.19,
...
2014-07-07 17:54:26 +04:00
APIs Documentations
===================
2015-01-01 21:40:43 +03:00
Glances includes a `XML-RPC server`_ and a `RESTFUL-JSON`_ API which and can be used by another client software.
2013-04-08 18:16:00 +04:00
2014-07-07 17:54:26 +04:00
APIs documentations are available at:
2013-04-08 18:16:00 +04:00
2014-07-07 17:54:26 +04:00
- XML-RPC: https://github.com/nicolargo/glances/wiki/The-Glances-2.x-API-How-to
2015-01-01 21:50:21 +03:00
- RESTFUL-JSON: https://github.com/nicolargo/glances/wiki/The-Glances-RESTFULL-JSON-API
2013-12-30 19:45:45 +04:00
2013-04-08 18:16:00 +04:00
Support
=======
2014-09-13 11:25:42 +04:00
To post a question about Glances use case, please post it to the offical Q&A `forum`_.
2014-06-08 22:44:49 +04:00
To report a bug or a feature request use the bug tracking system at
https://github.com/nicolargo/glances/issues.
2013-04-08 18:16:00 +04:00
2014-09-13 11:25:42 +04:00
Feel free to contribute !
2013-04-08 18:16:00 +04:00
.. [1] http://nosheep.net/story/defining-unix-load-average/
2014-06-08 22:44:49 +04:00
.. [2] https://github.com/nicolargo/batinfo
2013-04-08 18:16:00 +04:00
.. _psutil: https://code.google.com/p/psutil/
.. _XML-RPC server: http://docs.python.org/2/library/simplexmlrpcserver.html
2015-01-01 21:40:43 +03:00
.. _RESTFUL-JSON: http://jsonapi.org/
2014-10-30 14:53:28 +03:00
.. _forum: https://groups.google.com/forum/?hl=en#!forum/glances-users