README.rst 10.2 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

A
Alessio Sergi 已提交
12
.. image:: https://img.shields.io/travis/nicolargo/glances/master.svg?maxAge=3600&label=Linux%20/%20BSD%20/%20macOS
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
Summary
=======

28 29 30 31
**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.
N
nicolargo 已提交
32 33 34

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

35 36 37
It can also work in client/server mode. Remote monitoring could be done
via terminal, Web interface or API (XML-RPC and RESTful). Stats can also
be exported to files or external time/value databases.
N
nicolargo 已提交
38 39

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

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 new plugins or exports modules.
A
Alessio Sergi 已提交
44 45 46 47

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

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

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

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

77
*Note for Python 2.6 users*
N
nicolargo 已提交
78

79 80 81 82 83 84 85 86
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 已提交
87

A
Alessio Sergi 已提交
88 89 90
Installation
============

N
Nicolargo 已提交
91 92 93 94
Several method to test/install Glances on your system. Choose your weapon !

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

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

.. code-block:: console

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

A
Alessio Sergi 已提交
103
or
104 105 106

.. code-block:: console

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

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

A
Alessio Sergi 已提交
112
PyPI: The simple way
N
Nicolas Hennion 已提交
113 114
--------------------

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

A
Alessio Sergi 已提交
118
To install, simply use ``pip``:
A
Alessio Sergi 已提交
119 120 121

.. code-block:: console

N
Nicolargo 已提交
122
    pip install glances
N
Nicolas Hennion 已提交
123

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

N
Nicolargo 已提交
129 130 131
*Note 2 (for the Wifi plugin)*: If you want to use the Wifi plugin, you need
to install the *wireless-tools* package on your system.

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

.. code-block:: console

137
    pip install glances[action,browser,cloud,cpuinfo,chart,docker,export,folders,gpu,ip,raid,snmp,web,wifi]
N
Nicolargo 已提交
138

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

.. code-block:: console

N
Nicolargo 已提交
143
    pip install --upgrade glances
144
    pip install --upgrade glances[...]
N
Nicolas Hennion 已提交
145

N
Nicolargo 已提交
146 147 148 149 150
If you need to install Glances in a specific user location, use:

.. code-block:: console

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

N
Nicolargo 已提交
153 154 155
Docker: the funny way
---------------------

156 157 158
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 !
N
Nicolargo 已提交
159 160 161 162 163 164 165

Get the Glances container:

.. code-block:: console

    docker pull nicolargo/glances

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

.. code-block:: console

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

172 173
Additionally, if you want to use your own glances.conf file, you can
create your own Dockerfile:
174 175 176 177 178 179 180

.. code-block:: console

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

181 182
Alternatively, you can specify something along the same lines with
docker run options:
183 184 185 186 187 188

.. 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 已提交
189

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

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

200 201 202
`Glances` is available on many Linux distributions, so you should be
able to install it using your favorite package manager. Be aware that
Glances may not be the latest one using this method.
A
Alessio Sergi 已提交
203

A
Alessio Sergi 已提交
204 205 206
FreeBSD
-------

A
Alessio Sergi 已提交
207
To install the binary package:
A
Alessio Sergi 已提交
208

A
Alessio Sergi 已提交
209 210 211 212
.. code-block:: console

    # pkg install py27-glances

A
Alessio Sergi 已提交
213 214 215
To install Glances from ports:

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

A
Alessio Sergi 已提交
217 218
    # cd /usr/ports/sysutils/py-glances/
    # make install clean
N
Nicolas Hennion 已提交
219

A
Alessio Sergi 已提交
220 221
macOS
-----
A
Alessio Sergi 已提交
222

A
Alessio Sergi 已提交
223
macOS users can install Glances using ``Homebrew`` or ``MacPorts``.
A
Alessio Sergi 已提交
224 225 226 227 228 229

Homebrew
````````

.. code-block:: console

230
    $ brew install python
N
Nicolargo 已提交
231
    $ pip install glances
A
Alessio Sergi 已提交
232 233 234 235 236 237 238 239 240 241 242

MacPorts
````````

.. code-block:: console

    $ sudo port install glances

Windows
-------

243 244
Install `Python`_ for Windows (Python 2.7.9+ and 3.4+ ship with pip) and
then just:
N
Nicolargo 已提交
245 246 247 248

.. code-block:: console

    $ pip install glances
A
Alessio Sergi 已提交
249

250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270
Android
-------

You need a rooted device and the `Termux`_ application (available on the
Google Store).

Start Termux on your device and enter:

.. code-block:: console

    $ apt update
    $ apt upgrade
    $ apt install clang python python-dev
    $ pip install glances

And start Glances:

.. code-block:: console

    $ glances

A
Alessio Sergi 已提交
271 272 273
Source
------

A
Alessio Sergi 已提交
274
To install Glances from source:
A
Alessio Sergi 已提交
275 276 277

.. code-block:: console

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

282
*Note*: Python headers are required to install psutil.
283

N
nicolargo 已提交
284 285 286
Chef
----

287 288
An awesome ``Chef`` cookbook is available to monitor your infrastructure:
https://supermarket.chef.io/cookbooks/glances (thanks to Antoine Rouyer)
N
nicolargo 已提交
289

A
Alessio Sergi 已提交
290 291 292
Puppet
------

A
Alessio Sergi 已提交
293
You can install Glances using ``Puppet``: https://github.com/rverchere/puppet-glances
A
Alessio Sergi 已提交
294 295 296 297

Usage
=====

N
Nicolargo 已提交
298
For the standalone mode, just run:
A
Alessio Sergi 已提交
299 300 301

.. code-block:: console

302
    $ glances
A
Alessio Sergi 已提交
303

N
Nicolargo 已提交
304 305 306 307 308 309
For the Web server mode, run:

.. code-block:: console

    $ glances -w

A
Alessio Sergi 已提交
310
and enter the URL ``http://<ip>:61208`` in your favorite web browser.
N
Nicolargo 已提交
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325

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 已提交
326 327
You can also detect and display all Glances servers available on your
network or defined in the configuration file:
N
Nicolargo 已提交
328 329 330

.. code-block:: console

N
Nicolargo 已提交
331
    $ glances --browser
N
Nicolargo 已提交
332

A
Alessio Sergi 已提交
333
and RTFM, always.
N
Nicolas Hennion 已提交
334

A
Alessio Sergi 已提交
335 336 337
Documentation
=============

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

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

N
Nicolargo 已提交
342 343 344
Gateway to other services
=========================

N
nicolargo 已提交
345 346 347
Glances can export stats to: ``CSV`` file, ``InfluxDB``, ``Cassandra``, ``CouchDB``,
``OpenTSDB``, ``StatsD``, ``ElasticSearch``, ``RabbitMQ/ActiveMQ``, ``ZeroMQ``,
and  ``Riemann`` server.
N
Nicolargo 已提交
348

N
Nicolargo 已提交
349 350 351
How to contribute ?
===================

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

A
Alessio Sergi 已提交
354
There is also a chat dedicated to the Glances developers:
N
Nicolargo 已提交
355 356 357 358

.. 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 已提交
359 360 361 362 363 364 365 366
Author
======

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

License
=======

A
Alessio Sergi 已提交
367
LGPLv3. See ``COPYING`` for more details.
A
Alessio Sergi 已提交
368

A
Alessio Sergi 已提交
369
.. _psutil: https://github.com/giampaolo/psutil
N
Nicolargo 已提交
370
.. _glancesautoinstall: https://github.com/nicolargo/glancesautoinstall
A
Alessio Sergi 已提交
371 372
.. _@nicolargo: https://twitter.com/nicolargo
.. _@glances_system: https://twitter.com/glances_system
373
.. _Python: https://www.python.org/getit/
374
.. _Termux: https://play.google.com/store/apps/details?id=com.termux
375
.. _readthedocs: https://glances.readthedocs.io/
N
Nicolargo 已提交
376
.. _forum: https://groups.google.com/forum/?hl=en#!forum/glances-users
377
.. _wiki: https://github.com/nicolargo/glances/wiki/How-to-contribute-to-Glances-%3F