README.rst 9.6 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]
A
Alessio Sergi 已提交
54

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

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

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

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

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

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

.. code-block:: console

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

A
Alessio Sergi 已提交
81
or
82 83 84

.. code-block:: console

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

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

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

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

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

.. code-block:: console

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

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

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

.. code-block:: console

N
nicolargo 已提交
112
    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
N
Nicolargo 已提交
113

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

.. code-block:: console

N
Nicolargo 已提交
118
    pip install --upgrade glances
N
nicolargo 已提交
119
    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
N
Nicolas Hennion 已提交
120

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

.. code-block:: console

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

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

Run the container in console mode:

.. code-block:: console

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

145 146 147 148 149
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 -p 61208:61208 -e GLANCES_OPT="-w" -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host docker.io/nicolargo/glances
N
Nicolargo 已提交
150

151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
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 已提交
167

N
Nicolargo 已提交
168 169
GNU/Linux
---------
A
Alessio Sergi 已提交
170

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

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

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

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

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

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

    # pkg install py27-glances

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

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

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

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

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

Homebrew
````````

.. code-block:: console

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

MacPorts
````````

.. code-block:: console

    $ sudo port install glances

Windows
-------

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

.. code-block:: console

    $ pip install glances
A
Alessio Sergi 已提交
229

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

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

.. code-block:: console

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

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

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

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

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

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

Usage
=====

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

.. code-block:: console

268
    $ glances
A
Alessio Sergi 已提交
269

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

.. code-block:: console

    $ glances -w

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

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

.. code-block:: console

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

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

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

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

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

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

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

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

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

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

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

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

License
=======

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

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