glances-doc.rst 16.4 KB
Newer Older
A
Alessio Sergi 已提交
1 2 3 4
=======
Glances
=======

N
Nicolargo 已提交
5
This manual describes *Glances* version 2.0.
A
Alessio Sergi 已提交
6

7
Copyright © 2012-2014 Nicolas Hennion <nicolas@nicolargo.com>
A
Alessio Sergi 已提交
8

A
Alessio Sergi 已提交
9
June 2014
A
Alessio Sergi 已提交
10 11 12 13 14 15

.. contents:: Table of Contents

Introduction
============

A
Alessio Sergi 已提交
16 17 18 19 20
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.
A
Alessio Sergi 已提交
21

A
Alessio Sergi 已提交
22 23
Glances can also work in client/server mode. Remote monitoring could be
done via terminal or web interface.
A
Alessio Sergi 已提交
24

A
Alessio Sergi 已提交
25 26
Glances is written in Python and uses the `psutil`_ library to get
information from your system.
A
Alessio Sergi 已提交
27 28 29 30 31 32 33 34 35

Console (80x24)

.. image:: images/screenshot.png

Full view (>80x24)

.. image:: images/screenshot-wide.png

N
Nicolargo 已提交
36 37 38 39
Web interface (Firefox)

.. image:: images/screenshot-web.png

A
Alessio Sergi 已提交
40 41 42
Usage
=====

A
Alessio Sergi 已提交
43
Standalone Mode
A
Alessio Sergi 已提交
44 45 46 47 48 49 50 51
---------------

Simply run:

.. code-block:: console

    $ glances

A
Alessio Sergi 已提交
52
Client/Server Mode
A
Alessio Sergi 已提交
53 54
------------------

A
Alessio Sergi 已提交
55 56
If you want to remotely monitor a machine, called ``server``, from
another one, called ``client``, just run on the server:
A
Alessio Sergi 已提交
57 58 59 60 61 62 63 64 65 66 67

.. code-block:: console

    server$ glances -s

and on the client:

.. code-block:: console

    client$ glances -c @server

A
Alessio Sergi 已提交
68
where ``@server`` is the IP address or hostname of the server.
A
Alessio Sergi 已提交
69

A
Alessio Sergi 已提交
70 71
In server mode, you can set the bind address ``-B ADDRESS`` and listening
TCP port ``-p PORT``.
A
Alessio Sergi 已提交
72 73 74

In client mode, you can set the TCP port of the server ``-p PORT``.

N
Nicolargo 已提交
75 76
You can also set a password to access to the server ``--password``.

A
Alessio Sergi 已提交
77 78
Default binding address is ``0.0.0.0`` (Glances will listen on all the
network interfaces) and TCP port is ``61209``.
A
Alessio Sergi 已提交
79 80 81

In client/server mode, limits are set by the server side.

A
Alessio Sergi 已提交
82 83
Glances is ``IPv6`` compatible. Just use the ``-B ::`` option to bind to
all IPv6 addresses.
N
Nicolas Hennion 已提交
84

A
Alessio Sergi 已提交
85 86
As an experimental feature, if Glances server is not detected by the
client, the latter will try to grab stats using the ``SNMP`` protocol:
N
Nicolargo 已提交
87 88 89

.. code-block:: console

A
Alessio Sergi 已提交
90
    client$ glances -c @snmpserver
N
Nicolargo 已提交
91

A
Alessio Sergi 已提交
92 93
Known issues: grab using SNMP is only validated for GNU/Linux with SNMP
v2/2c server.
N
Nicolargo 已提交
94

A
Alessio Sergi 已提交
95 96
Web Server Mode
---------------
N
Nicolargo 已提交
97

A
Alessio Sergi 已提交
98 99
If you want to remotely monitor a machine, called ``server``, from any
device with a web browser, called ``client``, just run on the server:
N
Nicolargo 已提交
100 101 102 103 104

.. code-block:: console

    server$ glances -w

A
Alessio Sergi 已提交
105 106 107
and on the client enter the following URL in your favorite web browser:

::
N
Nicolargo 已提交
108

A
Alessio Sergi 已提交
109
    http://@server:61208
N
Nicolargo 已提交
110 111

where ``@server`` is the IP address or hostname of the server.
N
Nicolargo 已提交
112

A
Alessio Sergi 已提交
113 114 115
The Glances web interface follows responsive web design principles.

Screenshot from Chrome on Android
116 117

.. image:: images/screenshot-web2.png
A
Alessio Sergi 已提交
118

N
Nicolas Hennion 已提交
119

A
Alessio Sergi 已提交
120
Command Reference
A
Alessio Sergi 已提交
121 122
=================

A
Alessio Sergi 已提交
123
Command-Line Options
A
Alessio Sergi 已提交
124 125
--------------------

N
Nicolargo 已提交
126
-h, --help            show this help message and exit
A
Alessio Sergi 已提交
127
-V, --version         show program's version number and exit
N
Nicolargo 已提交
128 129
-b, --byte            display network rate in byte per second
-B BIND_ADDRESS, --bind BIND_ADDRESS
A
Alessio Sergi 已提交
130
                      bind server to the given IPv4/IPv6 address or hostname
N
Nicolargo 已提交
131
-c CLIENT, --client CLIENT
A
Alessio Sergi 已提交
132 133
                      connect to a Glances server by IPv4/IPv6 address or
                      hostname
N
Nicolargo 已提交
134
-C CONF_FILE, --config CONF_FILE
A
Alessio Sergi 已提交
135
                      path to the configuration file
N
Nicolargo 已提交
136 137
--disable-bold        disable bold mode in the terminal
--disable-diskio      disable disk I/O module
A
Alessio Sergi 已提交
138
--disable-fs          disable file system module
N
Nicolargo 已提交
139 140 141 142 143
--disable-network     disable network module
--disable-sensors     disable sensors module
--disable-process     disable process module
--disable-log         disable log module
--output-csv OUTPUT_CSV
A
Alessio Sergi 已提交
144
                      export stats to a CSV file
N
Nicolargo 已提交
145
-p PORT, --port PORT  define the client/server TCP port [default: 61209]
A
Alessio Sergi 已提交
146 147
--password            define a client/server password from the prompt or
                      file
N
Nicolargo 已提交
148 149
-s, --server          run Glances in server mode
--snmp-community SNMP_COMMUNITY
A
Alessio Sergi 已提交
150
                      SNMP community
N
Nicolargo 已提交
151
--snmp-port SNMP_PORT
A
Alessio Sergi 已提交
152
                      SNMP port
N
Nicolargo 已提交
153
--snmp-version SNMP_VERSION
A
Alessio Sergi 已提交
154
                      SNMP version (1, 2c or 3)
N
Nicolargo 已提交
155
--snmp-user SNMP_USER
A
Alessio Sergi 已提交
156
                      SNMP username (only for SNMPv3)
N
Nicolargo 已提交
157
--snmp-auth SNMP_AUTH
A
Alessio Sergi 已提交
158
                      SNMP authentication key (only for SNMPv3)
N
Nicolargo 已提交
159
-t TIME, --time TIME  set refresh time in seconds [default: 3 sec]
A
Alessio Sergi 已提交
160
-w, --webserver       run Glances in Web server mode
N
Nicolargo 已提交
161
-1, --percpu          start Glances in per CPU mode
A
Alessio Sergi 已提交
162

A
Alessio Sergi 已提交
163
Interactive Commands
A
Alessio Sergi 已提交
164 165
--------------------

N
Nicolas Hennion 已提交
166
The following commands (key pressed) are supported while in Glances:
A
Alessio Sergi 已提交
167 168

``a``
A
Alessio Sergi 已提交
169
    Sort process list automatically
A
Alessio Sergi 已提交
170

A
Alessio Sergi 已提交
171
    - If CPU iowait ``>60%``, sort processes by I/O read and write
A
Alessio Sergi 已提交
172 173 174
    - If CPU ``>70%``, sort processes by CPU usage
    - If MEM ``>70%``, sort processes by memory usage
``b``
A
Alessio Sergi 已提交
175
    Switch between bit/s or Byte/s for network I/O
A
Alessio Sergi 已提交
176
``c``
A
Alessio Sergi 已提交
177
    Sort processes by CPU usage
A
Alessio Sergi 已提交
178 179 180 181 182
``d``
    Show/hide disk I/O stats
``f``
    Show/hide file system stats
``h``
A
Alessio Sergi 已提交
183
    Show/hide the help screen
A
Alessio Sergi 已提交
184
``i``
A
Alessio Sergi 已提交
185
    Sort processes by I/O rate
A
Alessio Sergi 已提交
186 187 188
``l``
    Show/hide log messages
``m``
A
Alessio Sergi 已提交
189
    Sort processes by MEM usage
A
Alessio Sergi 已提交
190 191 192 193
``n``
    Show/hide network stats
``p``
    Sort processes by name
A
Alessio Sergi 已提交
194 195
``q``
    Quit
A
Alessio Sergi 已提交
196
``s``
N
Nicolargo 已提交
197
    Show/hide sensors stats
A
Alessio Sergi 已提交
198
``t``
A
Alessio Sergi 已提交
199
    View network I/O as combination
A
Alessio Sergi 已提交
200
``u``
A
Alessio Sergi 已提交
201
    View cumulative network I/O
A
Alessio Sergi 已提交
202 203 204 205
``w``
    Delete finished warning log messages
``x``
    Delete finished warning and critical log messages
M
Markus Roth 已提交
206
``z``
A
Alessio Sergi 已提交
207
    Show/hide processes stats
A
Alessio Sergi 已提交
208 209 210 211 212 213
``1``
    Switch between global CPU and per-CPU stats

Configuration
=============

A
Alessio Sergi 已提交
214 215
**Caution! Glances version 1.x configuration files are not compatible
with the version 2.x.**
N
Nicolargo 已提交
216

N
Nicolas Hennion 已提交
217
No configuration file is mandatory to use Glances.
A
Alessio Sergi 已提交
218

A
Alessio Sergi 已提交
219 220
Furthermore a configuration file is needed to set up limits, disks or
network interfaces to hide and/or monitored processes list.
A
Alessio Sergi 已提交
221 222 223

By default, the configuration file is under:

224 225 226 227 228 229
: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:

A
Alessio Sergi 已提交
230
::
A
Alessio Sergi 已提交
231

232
    C:\Documents and Settings\<User>\Application Data
A
Alessio Sergi 已提交
233

234
Since Windows Vista and newer versions:
A
Alessio Sergi 已提交
235

A
Alessio Sergi 已提交
236
::
A
Alessio Sergi 已提交
237

238
    C:\Users\<User>\AppData\Roaming
A
Alessio Sergi 已提交
239

240 241 242
You can override the default configuration, located in one of the above
directories on your system, except for Windows.

A
Alessio Sergi 已提交
243 244
Just copy the ``glances.conf`` file to your ``$XDG_CONFIG_HOME`` directory,
e.g., on Linux:
A
Alessio Sergi 已提交
245 246 247 248

.. code-block:: console

    mkdir -p $XDG_CONFIG_HOME/glances
A
Alessio Sergi 已提交
249
    cp /usr/share/doc/glances/glances.conf $XDG_CONFIG_HOME/glances/
A
Alessio Sergi 已提交
250

A
Alessio Sergi 已提交
251 252
On OS X, you should copy the configuration file to
``~/Library/Application Support/glances/``.
A
Alessio Sergi 已提交
253

A
Alessio Sergi 已提交
254
Anatomy Of The Application
A
Alessio Sergi 已提交
255 256 257 258 259 260 261 262 263 264
==========================

Legend
------

| ``GREEN`` stat counter is ``"OK"``
| ``BLUE`` stat counter is ``"CAREFUL"``
| ``MAGENTA`` stat counter is ``"WARNING"``
| ``RED`` stat counter is ``"CRITICAL"``

A
Alessio Sergi 已提交
265 266
*Note*: only stats with colored background will be logged in the alert
view.
N
Nicolargo 已提交
267

A
Alessio Sergi 已提交
268 269 270 271 272
Header
------

.. image:: images/header.png

A
Alessio Sergi 已提交
273 274 275
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.
N
Nicolargo 已提交
276

A
Alessio Sergi 已提交
277
In client mode, the server connection status is displayed.
N
Nicolargo 已提交
278 279 280 281 282 283

Connected:

.. image:: images/connected.png

Disconnected:
284

N
Nicolargo 已提交
285
.. image:: images/disconnected.png
A
Alessio Sergi 已提交
286 287 288 289 290 291 292 293

CPU
---

Short view:

.. image:: images/cpu.png

A
Alessio Sergi 已提交
294 295
If enough horizontal space is available, extended CPU information are
displayed.
A
Alessio Sergi 已提交
296 297 298 299 300 301 302 303 304

Extended view:

.. image:: images/cpu-wide.png

To switch to per-CPU stats, just hit the ``1`` key:

.. image:: images/per-cpu.png

A
Alessio Sergi 已提交
305 306
The CPU stats are shown as a percentage and for the configured refresh
time. The total CPU usage is displayed on the first line.
A
Alessio Sergi 已提交
307

A
Alessio Sergi 已提交
308 309 310 311
| 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"``
A
Alessio Sergi 已提交
312

A
Alessio Sergi 已提交
313 314
*Note*: limit values can be overwritten in the configuration file under
the ``[cpu]`` and/or ``[percpu]`` sections.
N
Nicolas Hennion 已提交
315

A
Alessio Sergi 已提交
316 317 318 319 320
Load
----

.. image:: images/load.png

A
Alessio Sergi 已提交
321
On the *No Sheep* blog, *Zachary Tirrell* defines the load average [1]_:
A
Alessio Sergi 已提交
322 323 324

    "In short it is the average sum of the number of processes
    waiting in the run-queue plus the number currently executing
N
Nicolargo 已提交
325
    over 1, 5, and 15 minutes time periods."
A
Alessio Sergi 已提交
326 327

Glances gets the number of CPU core to adapt the alerts.
A
Alessio Sergi 已提交
328 329
Alerts on load average are only set on 15 minutes time period.
The first line also displays the number of CPU core.
A
Alessio Sergi 已提交
330

A
Alessio Sergi 已提交
331 332 333 334
| 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"``
A
Alessio Sergi 已提交
335

A
Alessio Sergi 已提交
336 337
*Note*: limit values can be overwritten in the configuration file under
the ``[load]`` section.
N
Nicolas Hennion 已提交
338

A
Alessio Sergi 已提交
339 340 341
Memory
------

A
Alessio Sergi 已提交
342
Glances uses two columns: one for the ``RAM`` and one for the ``SWAP``.
A
Alessio Sergi 已提交
343 344 345

.. image:: images/mem.png

A
Alessio Sergi 已提交
346 347
If enough space is available, Glances displays extended information for
the ``RAM``:
A
Alessio Sergi 已提交
348 349 350

.. image:: images/mem-wide.png

A
Alessio Sergi 已提交
351
Alerts are only set for used memory and used swap.
A
Alessio Sergi 已提交
352

A
Alessio Sergi 已提交
353 354 355 356
| 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"``
A
Alessio Sergi 已提交
357

A
Alessio Sergi 已提交
358 359
*Note*: limit values can be overwritten in the configuration file under
the ``[memory]`` and/or ``[memswap]`` sections.
N
Nicolas Hennion 已提交
360

A
Alessio Sergi 已提交
361 362 363 364 365 366 367 368
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).

A
Alessio Sergi 已提交
369 370
Alerts are only set if the maximum speed per network interface is available
(see sample in the configuration file).
A
Alessio Sergi 已提交
371

A
Alessio Sergi 已提交
372 373 374
*Note*: it is possibile to define a list of network interfaces to hide
and per-interface limit values in the ``[network]`` section of the
configuration file.
N
Nicolas Hennion 已提交
375

A
Alessio Sergi 已提交
376 377 378 379 380 381 382
Disk I/O
--------

.. image:: images/diskio.png

Glances displays the disk I/O throughput. The unit is adapted dynamically.

A
Alessio Sergi 已提交
383
There is no alert on this information.
A
Alessio Sergi 已提交
384

A
Alessio Sergi 已提交
385 386
*Note*: it is possible to define a list of disks to hide under the
``[diskio]`` section in the configuration file.
387

A
Alessio Sergi 已提交
388
File System
A
Alessio Sergi 已提交
389 390 391 392 393 394 395
-----------

.. image:: images/fs.png

Glances displays the used and total file system disk space. The unit is
adapted dynamically.

A
Alessio Sergi 已提交
396
Alerts are set for used disk space.
A
Alessio Sergi 已提交
397

A
Alessio Sergi 已提交
398 399 400 401
| 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"``
A
Alessio Sergi 已提交
402

A
Alessio Sergi 已提交
403 404
*Note*: limit values can be overwritten in the configuration file under
the ``[filesystem]`` section.
N
Nicolas Hennion 已提交
405

N
Nicolargo 已提交
406 407 408
Sensors
-------

A
Alessio Sergi 已提交
409 410
Glances can displays the sensors information using `lm-sensors`,
`hddtemp` and `batinfo` [2]_.
N
Nicolargo 已提交
411

A
Alessio Sergi 已提交
412
All of the above libraries are available only on Linux.
N
Nicolargo 已提交
413

A
Alessio Sergi 已提交
414 415
As of lm-sensors, a filter is being applied in order to display
temperature only.
A
Alessio Sergi 已提交
416

A
Alessio Sergi 已提交
417
.. image:: images/sensors.png
N
Nicolargo 已提交
418 419

There is no alert on this information.
A
Alessio Sergi 已提交
420

A
Alessio Sergi 已提交
421 422
*Note*: limit values can be overwritten in the configuration file under
the ``[sensors]`` section.
N
Nicolas Hennion 已提交
423

A
Alessio Sergi 已提交
424
Processes List
A
Alessio Sergi 已提交
425 426 427 428 429 430 431 432 433 434
--------------

Compact view:

.. image:: images/processlist.png

Full view:

.. image:: images/processlist-wide.png

N
Nicolas Hennion 已提交
435
Three views are available for processes:
A
Alessio Sergi 已提交
436 437

* Processes summary
A
Alessio Sergi 已提交
438
* Optional monitored processes list (see below)
N
Nicolas Hennion 已提交
439
* Processes list
A
Alessio Sergi 已提交
440

441 442 443
The processes summary line display:

* Tasks number (total number of processes)
A
Alessio Sergi 已提交
444
* Threads number
445 446 447
* Running tasks number
* Sleeping tasks number
* Other tasks number (not running or sleeping)
N
Nicolargo 已提交
448
* Sort key
449

A
Alessio Sergi 已提交
450 451
By default, or if you hit the ``a`` key, the processes list is
automatically sorted by:
A
Alessio Sergi 已提交
452

A
Alessio Sergi 已提交
453 454 455 456
* ``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
N
Nicolas Hennion 已提交
457

A
Alessio Sergi 已提交
458 459 460 461 462 463
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
N
Nicolargo 已提交
464
``VIRT``
N
Nicolas Hennion 已提交
465
    Total program size aka Virtual Memory Size (VMS)
N
Nicolargo 已提交
466
``RES``
N
Nicolas Hennion 已提交
467
    Resident Set Size (RSS)
A
Alessio Sergi 已提交
468 469 470
``PID``
    Process ID
``USER``
N
Nicolargo 已提交
471
    User ID
A
Alessio Sergi 已提交
472
``NI``
A
Alessio Sergi 已提交
473
    Nice level of the process (niceness other than 0 is highlighted)
A
Alessio Sergi 已提交
474
``S``
A
Alessio Sergi 已提交
475
    Process status (running process is highlighted)
A
Alessio Sergi 已提交
476 477 478
``TIME+``
    Cumulative CPU time used
``IOR/s``
A
Alessio Sergi 已提交
479
    Per process I/O read rate (in Byte/s)
A
Alessio Sergi 已提交
480
``IOW/s``
A
Alessio Sergi 已提交
481
    Per process I/O write rate (in Byte/s)
N
Nicolargo 已提交
482
``COMMAND``
N
Nicolargo 已提交
483
    Process command line (process name is highlighted)
A
Alessio Sergi 已提交
484 485 486 487

Process status legend:

``R``
N
Nicolargo 已提交
488
    Running
A
Alessio Sergi 已提交
489
``S``
N
Nicolargo 已提交
490
    Sleeping (may be interrupted)
A
Alessio Sergi 已提交
491
``D``
N
Nicolargo 已提交
492
    Disk sleep (may not be interrupted)
A
Alessio Sergi 已提交
493
``T``
N
Nicolargo 已提交
494
    Traced / Stopped
A
Alessio Sergi 已提交
495
``Z``
N
Nicolargo 已提交
496
    Zombie
A
Alessio Sergi 已提交
497

A
Alessio Sergi 已提交
498 499
*Note*: limits values can be overwritten in the configuration file under
the ``[process]`` section.
N
Nicolas Hennion 已提交
500

A
Alessio Sergi 已提交
501
Monitored Processes List
N
Nicolas Hennion 已提交
502 503
------------------------

A
Alessio Sergi 已提交
504
The monitored processes list allows user, through the configuration file,
A
Alessio Sergi 已提交
505 506
to group processes and quickly show if the number of running processes is
not good.
N
Nicolas Hennion 已提交
507

508 509
.. image:: images/monitored.png

N
Nicolas Hennion 已提交
510 511
Each item is defined by:

A
Alessio Sergi 已提交
512 513
* ``description``: description of the processes (max 16 chars).
* ``regex``: regular expression of the processes to monitor.
A
Alessio Sergi 已提交
514 515 516 517 518 519
* ``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.
N
Nicolas Hennion 已提交
520 521 522

Up to 10 items can be defined.

A
Alessio Sergi 已提交
523 524
For example, if you want to monitor the Nginx processes on a Web server,
the following definition should do the job:
A
Alessio Sergi 已提交
525

A
Alessio Sergi 已提交
526
::
N
Nicolas Hennion 已提交
527 528

    [monitor]
529
    list_1_description=Nginx server
N
Nicolas Hennion 已提交
530 531 532 533 534
    list_1_regex=.*nginx.*
    list_1_command=nginx -v
    list_1_countmin=1
    list_1_countmax=4

A
Alessio Sergi 已提交
535 536
If you also want to monitor the PHP-FPM daemon processes, you should add
another item:
A
Alessio Sergi 已提交
537

A
Alessio Sergi 已提交
538
::
N
Nicolas Hennion 已提交
539 540

    [monitor]
541
    list_1_description=Nginx server
N
Nicolas Hennion 已提交
542 543 544 545 546 547 548 549 550
    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

551
In client/server mode, the list is defined on the server side.
A
Alessio Sergi 已提交
552 553
A new method, called `getAllMonitored`, is available in the APIs and
get the JSON representation of the monitored processes list.
554

555
Alerts are set as following:
556 557

| If number of processes is 0, then status is set to ``"CRITICAL"``
558
| If number of processes is min < current < max, then status is set to ``"OK"``
559 560
| Else status is set to ``"WARNING"``

A
Alessio Sergi 已提交
561 562 563 564 565
Logs
----

.. image:: images/logs.png

A
Alessio Sergi 已提交
566 567
A log messages list is displayed in the bottom of the screen if (and
only if):
A
Alessio Sergi 已提交
568 569 570 571 572 573

- 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:

A
Alessio Sergi 已提交
574 575 576
1. start datetime
2. duration if alert is terminated or `ongoing` if the alert is still in
   progress
A
Alessio Sergi 已提交
577
3. alert name
A
Alessio Sergi 已提交
578 579
4. {min,avg,max} values or number of running processes for monitored
   processes list alerts
A
Alessio Sergi 已提交
580

A
Alessio Sergi 已提交
581 582
Other Outputs
=============
A
Alessio Sergi 已提交
583

N
Nicolargo 已提交
584
It is possible to export statistics to CSV file.
A
Alessio Sergi 已提交
585

N
Nicolas Hennion 已提交
586
.. code-block:: console
A
Alessio Sergi 已提交
587

N
Nicolargo 已提交
588
    $ glances --output-csv /tmp/glances.csv
A
Alessio Sergi 已提交
589

N
Nicolargo 已提交
590
CSV files have two lines per stats:
A
Alessio Sergi 已提交
591

N
Nicolargo 已提交
592 593
- Stats description
- Stats (comma separated)
N
Nicolas Hennion 已提交
594

A
Alessio Sergi 已提交
595
API Documentation
A
Alessio Sergi 已提交
596 597 598 599
=================

Glances uses a `XML-RPC server`_ and can be used by another client software.

N
Nicolargo 已提交
600
<<<<<<< HEAD
A
Alessio Sergi 已提交
601 602
API documentation is available at https://github.com/nicolargo/glances/wiki/The-Glances-API-How-To

A
Alessio Sergi 已提交
603 604
Other outputs
=============
N
Nicolas Hennion 已提交
605

A
Alessio Sergi 已提交
606
Thanks to the -o (output) option, it is possible to export statistics to `CSV` or `HTML` files.
N
Nicolas Hennion 已提交
607 608 609

.. code-block:: console

A
Alessio Sergi 已提交
610 611 612
    $ glances -o CSV -f /tmp

The CSV output file is named ``glances.csv``.
N
Nicolas Hennion 已提交
613 614 615 616 617 618

CSV files have on line per stats:

- load,load1,load5,load15
- mem,total,used,free
- swap,total,used,free
A
Alessio Sergi 已提交
619
- cpu,user,system,nice,idle,iowait,irq
N
Nicolas Hennion 已提交
620 621 622 623 624

.. code-block:: console

    $ glances -o HTML -f /tmp

A
Alessio Sergi 已提交
625 626 627
The HTML output file is named ``glances.html``.

*Note*: The css and img folders (glances/data) should be in the /tmp folder.
N
Nicolargo 已提交
628
=======
A
Alessio Sergi 已提交
629 630
API documentation is available at
https://github.com/nicolargo/glances/wiki/The-Glances-2.x-API-How-to.
N
Nicolargo 已提交
631
>>>>>>> release/v2.0
N
Nicolas Hennion 已提交
632

A
Alessio Sergi 已提交
633 634 635
Support
=======

A
Alessio Sergi 已提交
636 637
To report a bug or a feature request use the bug tracking system at
https://github.com/nicolargo/glances/issues.
A
Alessio Sergi 已提交
638 639 640 641 642

Feel free to contribute!


.. [1] http://nosheep.net/story/defining-unix-load-average/
A
Alessio Sergi 已提交
643
.. [2] https://github.com/nicolargo/batinfo
A
Alessio Sergi 已提交
644 645 646

.. _psutil: https://code.google.com/p/psutil/
.. _XML-RPC server: http://docs.python.org/2/library/simplexmlrpcserver.html