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

N
nicolargo 已提交
5

N
Nicolargo 已提交
6 7
.. image:: https://img.shields.io/pypi/v/glances.svg
    :target: https://pypi.python.org/pypi/Glances
N
nicolargo 已提交
8 9 10
.. image:: https://img.shields.io/github/stars/nicolargo/glances.svg
    :target: https://github.com/nicolargo/glances/
    :alt: Github stars
A
Alessio Sergi 已提交
11
.. image:: https://travis-ci.org/nicolargo/glances.svg?branch=master
N
Nicolargo 已提交
12 13 14
    :target: https://travis-ci.org/nicolargo/glances
.. image:: https://circleci.com/gh/nicolargo/glances/tree/develop.svg?style=svg
    :target: https://circleci.com/gh/nicolargo/glances/tree/develop
15
.. image:: https://img.shields.io/scrutinizer/g/nicolargo/glances.svg
N
Nicolargo 已提交
16
    :target: https://scrutinizer-ci.com/g/nicolargo/glances/
17
.. image:: https://api.flattr.com/button/flattr-badge-large.png
N
Nicolargo 已提交
18
    :target: https://flattr.com/thing/484466/nicolargoglances-on-GitHub
N
Nicolargo 已提交
19 20 21

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

A
Alessio Sergi 已提交
22 23
**Glances** is a cross-platform curses-based system monitoring tool
written in Python.
A
Alessio Sergi 已提交
24

N
nicolargo 已提交
25
.. image:: https://raw.githubusercontent.com/nicolargo/glances/develop/docs/_static/screencast.gif
A
Alessio Sergi 已提交
26 27 28 29

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

30 31
- ``python 2.7,>=3.3`` (tested with version 2.7, 3.3, 3.4, 3.5)
- ``psutil>=2.0.0``
A
Alessio Sergi 已提交
32 33
- ``setuptools``

A
Alessio Sergi 已提交
34
Optional dependencies:
A
Alessio Sergi 已提交
35

A
Alessio Sergi 已提交
36
- ``bottle`` (for Web server mode)
N
Nicolargo 已提交
37
- ``py3sensors`` (for hardware monitoring support) [Linux-only]
A
Alessio Sergi 已提交
38
- ``hddtemp`` (for HDD temperature monitoring support) [Linux-only]
A
Alessio Sergi 已提交
39
- ``batinfo`` (for battery monitoring support) [Linux-only]
A
Alessio Sergi 已提交
40
- ``pymdstat`` (for RAID support) [Linux-only]
A
Alessio Sergi 已提交
41
- ``pysnmp`` (for SNMP support)
42 43
- ``zeroconf`` (for the autodiscover mode)
- ``netifaces`` (for the IP plugin)
44
- ``influxdb`` (for the InfluxDB export module)
N
nicolargo 已提交
45
- ``cassandra-driver`` (for the Cassandra export module)
N
Nicolargo 已提交
46 47
- ``statsd`` (for the StatsD export module)
- ``pystache`` (for the action script feature)
N
Nicolargo 已提交
48
- ``docker-py`` (for the Docker monitoring support) [Linux-only]
49
- ``matplotlib`` (for graphical/chart support)
N
Nicolargo 已提交
50
- ``pika`` (for the RabbitMQ/ActiveMQ export module)
51
- ``bernhard`` (for the Riemann export module)
52
- ``py-cpuinfo`` (for the Quicklook CPU info module)
N
nicolargo 已提交
53
- ``scandir`` (for the Folders plugin) [Only for Python < 3.5]
54
- ``wifi`` (for the wifi plugin) [Linux-only]
A
Alessio Sergi 已提交
55

56
*Note for Python 2.6 users*
N
nicolargo 已提交
57

58 59 60 61 62 63 64 65
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 已提交
66

A
Alessio Sergi 已提交
67 68 69
Installation
============

N
Nicolargo 已提交
70 71 72 73
Several method to test/install Glances on your system. Choose your weapon !

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

A
Alessio Sergi 已提交
75 76
To install both dependencies and latest Glances production ready version
(aka *master* branch), just enter the following command line:
N
Nicolargo 已提交
77 78 79

.. code-block:: console

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

A
Alessio Sergi 已提交
82
or
83 84 85

.. code-block:: console

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

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

A
Alessio Sergi 已提交
91
PyPI: The simple way
N
Nicolas Hennion 已提交
92 93
--------------------

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

A
Alessio Sergi 已提交
97
To install, simply use ``pip``:
A
Alessio Sergi 已提交
98 99 100

.. code-block:: console

N
Nicolargo 已提交
101
    pip install glances
N
Nicolas Hennion 已提交
102

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

A
Alessio Sergi 已提交
108
You can also install the following libraries in order to use optional
109
features (like the Web interface, exports modules, sensors...):
N
Nicolargo 已提交
110 111 112

.. code-block:: console

N
nicolargo 已提交
113
    pip install bottle requests batinfo https://bitbucket.org/gleb_zhulik/py3sensors/get/tip.tar.gz zeroconf netifaces pymdstat influxdb elasticsearch potsdb statsd pystache docker-py pysnmp pika py-cpuinfo bernhard cassandra-driver scandir pyzmq
N
Nicolargo 已提交
114

N
Nicolas Hennion 已提交
115 116 117 118
To upgrade Glances to the latest version:

.. code-block:: console

N
Nicolargo 已提交
119
    pip install --upgrade glances
N
nicolargo 已提交
120
    pip install --upgrade bottle requests batinfo https://bitbucket.org/gleb_zhulik/py3sensors/get/tip.tar.gz zeroconf netifaces pymdstat influxdb elasticsearch potsdb statsd pystache docker-py pysnmp pika py-cpuinfo bernhard cassandra-driver scandir pyzmq
N
Nicolas Hennion 已提交
121

N
Nicolargo 已提交
122 123 124 125 126
If you need to install Glances in a specific user location, use:

.. code-block:: console

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

N
Nicolargo 已提交
129 130 131 132 133 134 135 136 137 138 139
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

140
Run the container in *console mode*:
N
Nicolargo 已提交
141 142 143 144

.. code-block:: console

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

146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
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 已提交
162

163 164 165 166 167 168
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 已提交
169 170
GNU/Linux
---------
A
Alessio Sergi 已提交
171

N
Nicolargo 已提交
172
At the moment, packages exist for the following GNU/Linux distributions:
A
Alessio Sergi 已提交
173 174

- Arch Linux
N
Nicolargo 已提交
175
- Debian
A
Alessio Sergi 已提交
176 177
- Fedora/CentOS/RHEL
- Gentoo
N
Nicolargo 已提交
178
- Slackware (SlackBuild)
N
Nicolargo 已提交
179
- Ubuntu
A
Alessio Sergi 已提交
180 181 182
- Void Linux

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

A
Alessio Sergi 已提交
185 186 187
FreeBSD
-------

A
Alessio Sergi 已提交
188
To install the binary package:
A
Alessio Sergi 已提交
189

A
Alessio Sergi 已提交
190 191 192 193
.. code-block:: console

    # pkg install py27-glances

A
Alessio Sergi 已提交
194 195 196
To install Glances from ports:

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

A
Alessio Sergi 已提交
198 199
    # cd /usr/ports/sysutils/py-glances/
    # make install clean
N
Nicolas Hennion 已提交
200

A
Alessio Sergi 已提交
201 202 203
OS X
----

A
Alessio Sergi 已提交
204
OS X users can install Glances using ``Homebrew`` or ``MacPorts``.
A
Alessio Sergi 已提交
205 206 207 208 209 210

Homebrew
````````

.. code-block:: console

211
    $ brew install python
N
Nicolargo 已提交
212
    $ pip install glances
A
Alessio Sergi 已提交
213 214 215 216 217 218 219 220 221 222 223

MacPorts
````````

.. code-block:: console

    $ sudo port install glances

Windows
-------

224 225
Install `Python`_ for Windows (Python 2.7.9+ and 3.4+ ship with pip) and
then just:
N
Nicolargo 已提交
226 227 228 229

.. code-block:: console

    $ pip install glances
A
Alessio Sergi 已提交
230

231 232 233 234 235 236 237
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 已提交
238 239 240
Source
------

A
Alessio Sergi 已提交
241
To install Glances from source:
A
Alessio Sergi 已提交
242 243 244

.. code-block:: console

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

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

N
nicolargo 已提交
252 253 254 255 256
Chef
----

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

A
Alessio Sergi 已提交
257 258 259
Puppet
------

A
Alessio Sergi 已提交
260
You can install Glances using ``Puppet``: https://github.com/rverchere/puppet-glances
A
Alessio Sergi 已提交
261 262 263 264

Usage
=====

N
Nicolargo 已提交
265
For the standalone mode, just run:
A
Alessio Sergi 已提交
266 267 268

.. code-block:: console

269
    $ glances
A
Alessio Sergi 已提交
270

N
Nicolargo 已提交
271 272 273 274 275 276
For the Web server mode, run:

.. code-block:: console

    $ glances -w

A
Alessio Sergi 已提交
277
and enter the URL ``http://<ip>:61208`` in your favorite web browser.
N
Nicolargo 已提交
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292

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 已提交
293 294
You can also detect and display all Glances servers available on your
network or defined in the configuration file:
N
Nicolargo 已提交
295 296 297

.. code-block:: console

N
Nicolargo 已提交
298
    $ glances --browser
N
Nicolargo 已提交
299

A
Alessio Sergi 已提交
300
and RTFM, always.
N
Nicolas Hennion 已提交
301

A
Alessio Sergi 已提交
302 303 304
Documentation
=============

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

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

N
Nicolargo 已提交
309 310 311
Gateway to other services
=========================

312 313
Glances can export stats to: ``CSV`` file, ``InfluxDB``, ``Cassandra``,
``OpenTSDB``, ``StatsD``, ``ElasticSearch``, ``RabbitMQ`` and  ``Riemann`` server.
N
Nicolargo 已提交
314

N
Nicolargo 已提交
315 316 317
How to contribute ?
===================

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

A
Alessio Sergi 已提交
320
There is also a chat dedicated to the Glances developers:
N
Nicolargo 已提交
321 322 323 324

.. 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 已提交
325 326 327 328 329 330 331 332 333 334
Author
======

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

License
=======

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

A
Alessio Sergi 已提交
335
.. _psutil: https://github.com/giampaolo/psutil
N
Nicolargo 已提交
336
.. _glancesautoinstall: https://github.com/nicolargo/glancesautoinstall
A
Alessio Sergi 已提交
337 338
.. _@nicolargo: https://twitter.com/nicolargo
.. _@glances_system: https://twitter.com/glances_system
339
.. _Python: https://www.python.org/getit/
340
.. _readthedocs: https://glances.readthedocs.io/
N
Nicolargo 已提交
341
.. _forum: https://groups.google.com/forum/?hl=en#!forum/glances-users
342
.. _wiki: https://github.com/nicolargo/glances/wiki/How-to-contribute-to-Glances-%3F