README.rst 10.7 KB
Newer Older
N
Nicolas Hennion 已提交
1 2 3 4
===============================
Glances - An eye on your system
===============================

N
Nicolargo 已提交
5 6
.. image:: https://img.shields.io/pypi/v/glances.svg
    :target: https://pypi.python.org/pypi/Glances
N
nicolargo 已提交
7

N
nicolargo 已提交
8 9 10
.. image:: https://img.shields.io/github/stars/nicolargo/glances.svg
    :target: https://github.com/nicolargo/glances/
    :alt: Github stars
N
nicolargo 已提交
11 12

.. image:: https://img.shields.io/travis/nicolargo/glances/master.svg?maxAge=3600&label=Linux%20/%20BSD%20/%20OSX
N
Nicolargo 已提交
13
    :target: https://travis-ci.org/nicolargo/glances
N
nicolargo 已提交
14 15 16 17 18 19
    :alt: Linux tests (Travis)

.. image:: https://img.shields.io/appveyor/ci/nicolargo/glances/master.svg?maxAge=3600&label=Windows
    :target: https://ci.appveyor.com/project/nicolargo/glances
    :alt: Windows tests (Appveyor)

20
.. image:: https://img.shields.io/scrutinizer/g/nicolargo/glances.svg
N
Nicolargo 已提交
21
    :target: https://scrutinizer-ci.com/g/nicolargo/glances/
N
Nicolargo 已提交
22 23 24

Follow Glances on Twitter: `@nicolargo`_ or `@glances_system`_

N
nicolargo 已提交
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
Summary
=======

**Glances** is a cross-platform monitoring tool which aims to present a maximum
of information in a minimum of space through a curses or Web based interface.
It can adapt dynamically the displayed information depending on the user
interface size.

.. image:: https://raw.githubusercontent.com/nicolargo/glances/develop/docs/_static/glances-summary.png

It can also work in client/server mode. Remote monitoring could be done via
terminal, Web interface or API (XMLRPC and RESTful). Stats can also be exported
to files or external time/value databases.

.. image:: https://raw.githubusercontent.com/nicolargo/glances/develop/docs/_static/glances-responsive-webdesign.png
A
Alessio Sergi 已提交
40

N
nicolargo 已提交
41 42 43
Glances is written in Python and uses libraries to grab information from your
system. It is based on an open architecture where developers can add news
plugins or exports modules.
A
Alessio Sergi 已提交
44 45 46 47

Requirements
============

48
- ``python 2.7,>=3.3`` (tested with version 2.7, 3.3, 3.4, 3.5)
N
nicolargo 已提交
49
- ``psutil>=2.0.0`` (better with latest version)
A
Alessio Sergi 已提交
50 51
- ``setuptools``

A
Alessio Sergi 已提交
52
Optional dependencies:
A
Alessio Sergi 已提交
53

A
Alessio Sergi 已提交
54
- ``batinfo`` (for battery monitoring support) [Linux-only]
N
nicolargo 已提交
55 56
- ``bernhard`` (for the Riemann export module)
- ``bottle`` (for Web server mode)
N
nicolargo 已提交
57
- ``cassandra-driver`` (for the Cassandra export module)
N
nicolargo 已提交
58
- ``couchdb`` (for the CouchDB export module)
N
Nicolargo 已提交
59
- ``docker-py`` (for the Docker monitoring support) [Linux-only]
N
nicolargo 已提交
60 61 62
- ``elasticsearch`` (for the Elastic Search export module)
- ``hddtemp`` (for HDD temperature monitoring support) [Linux-only]
- ``influxdb`` (for the InfluxDB export module)
63
- ``matplotlib`` (for graphical/chart support)
N
nicolargo 已提交
64 65
- ``netifaces`` (for the IP plugin)
- ``nvidia-ml-py`` (for the GPU plugin)
N
Nicolargo 已提交
66
- ``pika`` (for the RabbitMQ/ActiveMQ export module)
N
nicolargo 已提交
67 68
- ``potsdb`` (for the OpenTSDB export module)
- ``py3sensors`` (for hardware monitoring support) [Linux-only]
69
- ``py-cpuinfo`` (for the Quicklook CPU info module)
N
nicolargo 已提交
70 71 72 73 74
- ``pymdstat`` (for RAID support) [Linux-only]
- ``pysnmp`` (for SNMP support)
- ``pystache`` (for the action script feature)
- ``pyzmq`` (for the ZeroMQ export module)
- ``requests`` (for the Ports plugin)
N
nicolargo 已提交
75
- ``scandir`` (for the Folders plugin) [Only for Python < 3.5]
N
nicolargo 已提交
76
- ``statsd`` (for the StatsD export module)
77
- ``wifi`` (for the wifi plugin) [Linux-only]
N
nicolargo 已提交
78
- ``zeroconf`` (for the autodiscover mode)
A
Alessio Sergi 已提交
79

80
*Note for Python 2.6 users*
N
nicolargo 已提交
81

82 83 84 85 86 87 88 89
Since version 2.7, Glances no longer support Python 2.6. Please upgrade
to at least Python 2.7/3.3+ or downgrade to Glances 2.6.2 (latest version
with Python 2.6 support).

*Note for CentOS Linux 6 and 7 users*

Python 2.7, 3.3 and 3.4 are now available via SCLs. See:
https://lists.centos.org/pipermail/centos-announce/2015-December/021555.html.
N
nicolargo 已提交
90

A
Alessio Sergi 已提交
91 92 93
Installation
============

N
Nicolargo 已提交
94 95 96 97
Several method to test/install Glances on your system. Choose your weapon !

Glances Auto Install script: the total way
------------------------------------------
N
Nicolargo 已提交
98

A
Alessio Sergi 已提交
99 100
To install both dependencies and latest Glances production ready version
(aka *master* branch), just enter the following command line:
N
Nicolargo 已提交
101 102 103

.. code-block:: console

N
Nicolargo 已提交
104
    curl -L https://bit.ly/glances | /bin/bash
N
Nicolargo 已提交
105

A
Alessio Sergi 已提交
106
or
107 108 109

.. code-block:: console

N
Nicolargo 已提交
110
    wget -O- https://bit.ly/glances | /bin/bash
111

A
Alessio Sergi 已提交
112 113
*Note*: Only supported on some GNU/Linux distributions. If you want to
support other distributions, please contribute to `glancesautoinstall`_.
N
Nicolargo 已提交
114

A
Alessio Sergi 已提交
115
PyPI: The simple way
N
Nicolas Hennion 已提交
116 117
--------------------

A
Alessio Sergi 已提交
118
Glances is on ``PyPI``. By using PyPI, you are sure to have the latest
A
Alessio Sergi 已提交
119
stable version.
N
Nicolargo 已提交
120

A
Alessio Sergi 已提交
121
To install, simply use ``pip``:
A
Alessio Sergi 已提交
122 123 124

.. code-block:: console

N
Nicolargo 已提交
125
    pip install glances
N
Nicolas Hennion 已提交
126

N
nicolargo 已提交
127
*Note*: Python headers are required to install `psutil`_. For example,
A
Alessio Sergi 已提交
128
on Debian/Ubuntu you need to install first the *python-dev* package.
129 130
For Fedora/CentOS/RHEL install first *python-devel* package. For Windows,
just install PsUtil from the binary installation file.
A
Alessio Sergi 已提交
131

A
Alessio Sergi 已提交
132
You can also install the following libraries in order to use optional
133
features (like the Web interface, exports modules, sensors...):
N
Nicolargo 已提交
134 135 136

.. code-block:: console

N
nicolargo 已提交
137 138
    curl -o /tmp/optional-requirements.txt https://raw.githubusercontent.com/nicolargo/glances/master/optional-requirements.txt
    pip install -r /tmp/optional-requirements.txt
N
Nicolargo 已提交
139

N
Nicolas Hennion 已提交
140 141 142 143
To upgrade Glances to the latest version:

.. code-block:: console

N
Nicolargo 已提交
144
    pip install --upgrade glances
N
nicolargo 已提交
145 146 147 148
    curl -o /tmp/requirements.txt https://raw.githubusercontent.com/nicolargo/glances/master/requirements.txt
    pip install --upgrade /tmp/requirements.txt
    curl -o /tmp/optional-requirements.txt https://raw.githubusercontent.com/nicolargo/glances/master/optional-requirements.txt
    pip install --upgrade /tmp/optional-requirements.txt
N
Nicolas Hennion 已提交
149

N
Nicolargo 已提交
150 151 152 153 154
If you need to install Glances in a specific user location, use:

.. code-block:: console

    export PYTHONUSERBASE=~/mylocalpath
N
Nicolargo 已提交
155
    pip install --user glances
N
Nicolargo 已提交
156

N
Nicolargo 已提交
157 158 159 160 161 162 163 164 165 166 167
Docker: the funny way
---------------------

A Glances container is available. It will include the latest development HEAD version. You can use it to monitor your server and all your others containers !

Get the Glances container:

.. code-block:: console

    docker pull nicolargo/glances

168
Run the container in *console mode*:
N
Nicolargo 已提交
169 170 171 172

.. code-block:: console

    docker run -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host -it docker.io/nicolargo/glances
N
nicolargo 已提交
173

174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
Additionally, If you want to use your own glances.conf file, you can create your
own Dockerfile:

.. code-block:: console

    FROM nicolargo/glances
    COPY glances.conf /glances/conf/glances.conf
    CMD python -m glances -C /glances/conf/glances.conf $GLANCES_OPT

Alternatively, you can specify something along the same lines with docker run options:

.. code-block:: console

    docker run -v ./glances.conf:/glances/conf/glances.conf -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host -it docker.io/nicolargo/glances

Where ./glances.conf is a local directory containing your glances.conf file.
N
Nicolargo 已提交
190

191 192 193 194 195 196
Run the container in *Web server mode* (notice the GLANCES_OPT environment variable setting parameters for the glances startup command) :

.. code-block:: console

    docker run -d --restart="always" -p 61208-61209:61208-61209 -e GLANCES_OPT="-w" -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host docker.io/nicolargo/glances

N
Nicolargo 已提交
197 198
GNU/Linux
---------
A
Alessio Sergi 已提交
199

N
Nicolargo 已提交
200
At the moment, packages exist for the following GNU/Linux distributions:
A
Alessio Sergi 已提交
201 202

- Arch Linux
N
Nicolargo 已提交
203
- Debian
A
Alessio Sergi 已提交
204 205
- Fedora/CentOS/RHEL
- Gentoo
N
Nicolargo 已提交
206
- Slackware (SlackBuild)
N
Nicolargo 已提交
207
- Ubuntu
A
Alessio Sergi 已提交
208 209 210
- Void Linux

So you should be able to install it using your favorite package manager.
211
Be aware that the Glances version can not be the latest one using this method.
A
Alessio Sergi 已提交
212

A
Alessio Sergi 已提交
213 214 215
FreeBSD
-------

A
Alessio Sergi 已提交
216
To install the binary package:
A
Alessio Sergi 已提交
217

A
Alessio Sergi 已提交
218 219 220 221
.. code-block:: console

    # pkg install py27-glances

A
Alessio Sergi 已提交
222 223 224
To install Glances from ports:

.. code-block:: console
A
Alessio Sergi 已提交
225

A
Alessio Sergi 已提交
226 227
    # cd /usr/ports/sysutils/py-glances/
    # make install clean
N
Nicolas Hennion 已提交
228

A
Alessio Sergi 已提交
229 230 231
OS X
----

A
Alessio Sergi 已提交
232
OS X users can install Glances using ``Homebrew`` or ``MacPorts``.
A
Alessio Sergi 已提交
233 234 235 236 237 238

Homebrew
````````

.. code-block:: console

239
    $ brew install python
N
Nicolargo 已提交
240
    $ pip install glances
A
Alessio Sergi 已提交
241 242 243 244 245 246 247 248 249 250 251

MacPorts
````````

.. code-block:: console

    $ sudo port install glances

Windows
-------

252 253
Install `Python`_ for Windows (Python 2.7.9+ and 3.4+ ship with pip) and
then just:
N
Nicolargo 已提交
254 255 256 257

.. code-block:: console

    $ pip install glances
A
Alessio Sergi 已提交
258

259 260 261 262 263 264 265
You can also install the following libraries in order to use optional
features (like the Web interface, exports modules, sensors...):

.. code-block:: console

    pip install bottle requests zeroconf netifaces influxdb elasticsearch potsdb statsd pystache pysnmp pika py-cpuinfo bernhard cassandra scandir

A
Alessio Sergi 已提交
266 267 268
Source
------

A
Alessio Sergi 已提交
269
To install Glances from source:
A
Alessio Sergi 已提交
270 271 272

.. code-block:: console

273
    $ wget https://github.com/nicolargo/glances/archive/vX.Y.tar.gz -O - | tar xz
A
Alessio Sergi 已提交
274 275 276
    $ cd glances-*
    # python setup.py install

A
Alessio Sergi 已提交
277 278
*Note*: Python headers are required to install psutil. For example,
on Debian/Ubuntu you need to install first the *python-dev* package.
279

N
nicolargo 已提交
280 281 282 283 284
Chef
----

An awesome ``Chef`` cookbook is available to monitor your infrastructure: https://supermarket.chef.io/cookbooks/glances (thanks to Antoine Rouyer)

A
Alessio Sergi 已提交
285 286 287
Puppet
------

A
Alessio Sergi 已提交
288
You can install Glances using ``Puppet``: https://github.com/rverchere/puppet-glances
A
Alessio Sergi 已提交
289 290 291 292

Usage
=====

N
Nicolargo 已提交
293
For the standalone mode, just run:
A
Alessio Sergi 已提交
294 295 296

.. code-block:: console

297
    $ glances
A
Alessio Sergi 已提交
298

N
Nicolargo 已提交
299 300 301 302 303 304
For the Web server mode, run:

.. code-block:: console

    $ glances -w

A
Alessio Sergi 已提交
305
and enter the URL ``http://<ip>:61208`` in your favorite web browser.
N
Nicolargo 已提交
306 307 308 309 310 311 312 313 314 315 316 317 318 319 320

For the client/server mode, run:

.. code-block:: console

    $ glances -s

on the server side and run:

.. code-block:: console

    $ glances -c <ip>

on the client one.

A
Alessio Sergi 已提交
321 322
You can also detect and display all Glances servers available on your
network or defined in the configuration file:
N
Nicolargo 已提交
323 324 325

.. code-block:: console

N
Nicolargo 已提交
326
    $ glances --browser
N
Nicolargo 已提交
327

A
Alessio Sergi 已提交
328
and RTFM, always.
N
Nicolas Hennion 已提交
329

A
Alessio Sergi 已提交
330 331 332
Documentation
=============

A
Alessio Sergi 已提交
333
For complete documentation have a look at the readthedocs_ website.
A
Alessio Sergi 已提交
334

A
Alessio Sergi 已提交
335
If you have any question (after RTFM!), please post it on the official Q&A `forum`_.
N
Nicolargo 已提交
336

N
Nicolargo 已提交
337 338 339
Gateway to other services
=========================

N
nicolargo 已提交
340 341 342
Glances can export stats to: ``CSV`` file, ``InfluxDB``, ``Cassandra``, ``CouchDB``,
``OpenTSDB``, ``StatsD``, ``ElasticSearch``, ``RabbitMQ/ActiveMQ``, ``ZeroMQ``,
and  ``Riemann`` server.
N
Nicolargo 已提交
343

N
Nicolargo 已提交
344 345 346
How to contribute ?
===================

347
If you want to contribute to the Glances project, read this `wiki`_ page.
N
Nicolargo 已提交
348

A
Alessio Sergi 已提交
349
There is also a chat dedicated to the Glances developers:
N
Nicolargo 已提交
350 351 352 353

.. image:: https://badges.gitter.im/Join%20Chat.svg
        :target: https://gitter.im/nicolargo/glances?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge

A
Alessio Sergi 已提交
354 355 356 357 358 359 360 361 362 363
Author
======

Nicolas Hennion (@nicolargo) <nicolas@nicolargo.com>

License
=======

LGPL. See ``COPYING`` for more details.

A
Alessio Sergi 已提交
364
.. _psutil: https://github.com/giampaolo/psutil
N
Nicolargo 已提交
365
.. _glancesautoinstall: https://github.com/nicolargo/glancesautoinstall
A
Alessio Sergi 已提交
366 367
.. _@nicolargo: https://twitter.com/nicolargo
.. _@glances_system: https://twitter.com/glances_system
368
.. _Python: https://www.python.org/getit/
369
.. _readthedocs: https://glances.readthedocs.io/
N
Nicolargo 已提交
370
.. _forum: https://groups.google.com/forum/?hl=en#!forum/glances-users
371
.. _wiki: https://github.com/nicolargo/glances/wiki/How-to-contribute-to-Glances-%3F