You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

402 lines
11 KiB

4 years ago
  1. ===============================
  2. Glances - An eye on your system
  3. ===============================
  4. .. image:: https://img.shields.io/pypi/v/glances.svg
  5. :target: https://pypi.python.org/pypi/Glances
  6. .. image:: https://img.shields.io/github/stars/nicolargo/glances.svg
  7. :target: https://github.com/nicolargo/glances/
  8. :alt: Github stars
  9. .. image:: https://img.shields.io/travis/nicolargo/glances/master.svg?maxAge=3600&label=Linux%20/%20BSD%20/%20macOS
  10. :target: https://travis-ci.org/nicolargo/glances
  11. :alt: Linux tests (Travis)
  12. .. image:: https://img.shields.io/appveyor/ci/nicolargo/glances/master.svg?maxAge=3600&label=Windows
  13. :target: https://ci.appveyor.com/project/nicolargo/glances
  14. :alt: Windows tests (Appveyor)
  15. .. image:: https://img.shields.io/scrutinizer/g/nicolargo/glances.svg
  16. :target: https://scrutinizer-ci.com/g/nicolargo/glances/
  17. .. image:: https://app.fossa.io/api/projects/git%2Bgithub.com%2Fnicolargo%2Fglances.svg?type=shield
  18. :target: https://app.fossa.io/projects/git%2Bgithub.com%2Fnicolargo%2Fglances?ref=badge_shield
  19. .. image:: https://img.shields.io/badge/Donate-PayPal-green.svg
  20. :target: https://www.paypal.me/nicolargo
  21. Follow Glances on Twitter: `@nicolargo`_
  22. Summary
  23. =======
  24. **Glances** is a cross-platform monitoring tool which aims to present a
  25. large amount of monitoring information through a curses or Web
  26. based interface. The information dynamically adapts depending on the
  27. size of the user interface.
  28. .. image:: https://raw.githubusercontent.com/nicolargo/glances/develop/docs/_static/glances-summary.png
  29. It can also work in client/server mode. Remote monitoring could be done
  30. via terminal, Web interface or API (XML-RPC and RESTful). Stats can also
  31. be exported to files or external time/value databases.
  32. .. image:: https://raw.githubusercontent.com/nicolargo/glances/develop/docs/_static/glances-responsive-webdesign.png
  33. Glances is written in Python and uses libraries to grab information from
  34. your system. It is based on an open architecture where developers can
  35. add new plugins or exports modules.
  36. Requirements
  37. ============
  38. - ``python 2.7,>=3.4``
  39. - ``psutil>=5.3.0`` (better with latest version)
  40. Optional dependencies:
  41. - ``bernhard`` (for the Riemann export module)
  42. - ``bottle`` (for Web server mode)
  43. - ``cassandra-driver`` (for the Cassandra export module)
  44. - ``couchdb`` (for the CouchDB export module)
  45. - ``docker`` (for the Docker monitoring support) [Linux-only]
  46. - ``elasticsearch`` (for the Elastic Search export module)
  47. - ``hddtemp`` (for HDD temperature monitoring support) [Linux-only]
  48. - ``influxdb`` (for the InfluxDB export module)
  49. - ``kafka-python`` (for the Kafka export module)
  50. - ``netifaces`` (for the IP plugin)
  51. - ``nvidia-ml-py3`` (for the GPU plugin)
  52. - ``pika`` (for the RabbitMQ/ActiveMQ export module)
  53. - ``potsdb`` (for the OpenTSDB export module)
  54. - ``prometheus_client`` (for the Prometheus export module)
  55. - ``py-cpuinfo`` (for the Quicklook CPU info module)
  56. - ``pygal`` (for the graph export module)
  57. - ``pymdstat`` (for RAID support) [Linux-only]
  58. - ``pysnmp`` (for SNMP support)
  59. - ``pystache`` (for the action script feature)
  60. - ``pyzmq`` (for the ZeroMQ export module)
  61. - ``requests`` (for the Ports, Cloud plugins and RESTful export module)
  62. - ``scandir`` (for the Folders plugin) [Only for Python < 3.5]
  63. - ``statsd`` (for the StatsD export module)
  64. - ``wifi`` (for the wifi plugin) [Linux-only]
  65. - ``zeroconf`` (for the autodiscover mode)
  66. *Note for Python 2.6 users*
  67. Glances no longer supports Python 2.6. Please upgrade
  68. to a minimum Python version of 2.7/3.4+ or downgrade to Glances 2.6.2 (last version
  69. with Python 2.6 support).
  70. *Note for CentOS Linux 6 and 7 users*
  71. Python 2.7 and 3.4 are now available via SCL repositories. See:
  72. https://lists.centos.org/pipermail/centos-announce/2015-December/021555.html.
  73. Installation
  74. ============
  75. There are several methods to test/install Glances on your system. Choose your weapon!
  76. Glances Auto Install script: the total way
  77. ------------------------------------------
  78. To install both dependencies and the latest Glances production ready version
  79. (aka *master* branch), just enter the following command line:
  80. .. code-block:: console
  81. curl -L https://bit.ly/glances | /bin/bash
  82. or
  83. .. code-block:: console
  84. wget -O- https://bit.ly/glances | /bin/bash
  85. *Note*: This is only supported on some GNU/Linux distributions. If you want to
  86. support other distributions, please contribute to `glancesautoinstall`_.
  87. PyPI: The simple way
  88. --------------------
  89. Glances is on ``PyPI``. By using PyPI, you will be using the latest
  90. stable version.
  91. To install, simply use ``pip``:
  92. .. code-block:: console
  93. pip install glances
  94. *Note*: Python headers are required to install `psutil`_. For example,
  95. on Debian/Ubuntu you need to install first the *python-dev* package.
  96. For Fedora/CentOS/RHEL install first *python-devel* package. For Windows,
  97. just install psutil from the binary installation file.
  98. *Note 2 (for the Wifi plugin)*: If you want to use the Wifi plugin, you need
  99. to install the *wireless-tools* package on your system.
  100. You can also install the following libraries in order to use optional
  101. features (like the Web interface, exports modules...):
  102. .. code-block:: console
  103. pip install 'glances[action,browser,cloud,cpuinfo,chart,docker,export,folders,gpu,ip,raid,snmp,web,wifi]'
  104. To upgrade Glances to the latest version:
  105. .. code-block:: console
  106. pip install --upgrade glances
  107. pip install --upgrade glances[...]
  108. If you need to install Glances in a specific user location, use:
  109. .. code-block:: console
  110. export PYTHONUSERBASE=~/mylocalpath
  111. pip install --user glances
  112. Docker: the funny way
  113. ---------------------
  114. A Glances container is available. It includes the latest development
  115. HEAD version. You can use it to monitor your server and all your other
  116. containers!
  117. Get the Glances container:
  118. .. code-block:: console
  119. docker pull nicolargo/glances
  120. Run the container in *console mode*:
  121. .. code-block:: console
  122. docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host --network host -it docker.io/nicolargo/glances
  123. Additionally, if you want to use your own glances.conf file, you can
  124. create your own Dockerfile:
  125. .. code-block:: console
  126. FROM nicolargo/glances
  127. COPY glances.conf /glances/conf/glances.conf
  128. CMD python -m glances -C /glances/conf/glances.conf $GLANCES_OPT
  129. Alternatively, you can specify something along the same lines with
  130. docker run options:
  131. .. code-block:: console
  132. 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
  133. Where ./glances.conf is a local directory containing your glances.conf file.
  134. Run the container in *Web server mode* (notice the `GLANCES_OPT` environment
  135. variable setting parameters for the glances startup command):
  136. .. code-block:: console
  137. 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
  138. GNU/Linux
  139. ---------
  140. `Glances` is available on many Linux distributions, so you should be
  141. able to install it using your favorite package manager. Be aware that
  142. when you use this method the operating system package for `Glances`
  143. may not be the latest version.
  144. FreeBSD
  145. -------
  146. To install the binary package:
  147. .. code-block:: console
  148. # pkg install py27-glances
  149. To install Glances from ports:
  150. .. code-block:: console
  151. # cd /usr/ports/sysutils/py-glances/
  152. # make install clean
  153. macOS
  154. -----
  155. macOS users can install Glances using ``Homebrew`` or ``MacPorts``.
  156. Homebrew
  157. ````````
  158. .. code-block:: console
  159. $ brew install glances
  160. MacPorts
  161. ````````
  162. .. code-block:: console
  163. $ sudo port install glances
  164. Windows
  165. -------
  166. Install `Python`_ for Windows (Python 2.7.9+ and 3.4+ ship with pip) and
  167. then run the following command:
  168. .. code-block:: console
  169. $ pip install glances
  170. Alternatively, you could clone the repository and install with the following command.
  171. .. code-block:: console
  172. $ git clone https://github.com/nicolargo/glances.git
  173. $ cd glances
  174. $ python setup.py install
  175. Android
  176. -------
  177. You need a rooted device and the `Termux`_ application (available on the
  178. Google Play Store).
  179. Start Termux on your device and enter:
  180. .. code-block:: console
  181. $ apt update
  182. $ apt upgrade
  183. $ apt install clang python python-dev
  184. $ pip install bottle
  185. $ pip install glances
  186. And start Glances:
  187. .. code-block:: console
  188. $ glances
  189. You can also run Glances in server mode (-s or -w) in order to remotely
  190. monitor your Android device.
  191. Source
  192. ------
  193. To install Glances from source:
  194. .. code-block:: console
  195. $ wget https://github.com/nicolargo/glances/archive/vX.Y.tar.gz -O - | tar xz
  196. $ cd glances-*
  197. # python setup.py install
  198. *Note*: Python headers are required to install psutil.
  199. Chef
  200. ----
  201. An awesome ``Chef`` cookbook is available to monitor your infrastructure:
  202. https://supermarket.chef.io/cookbooks/glances (thanks to Antoine Rouyer)
  203. Puppet
  204. ------
  205. You can install Glances using ``Puppet``: https://github.com/rverchere/puppet-glances
  206. Ansible
  207. -------
  208. A Glances ``Ansible`` role is available: https://galaxy.ansible.com/zaxos/glances-ansible-role/
  209. Usage
  210. =====
  211. For the standalone mode, just run:
  212. .. code-block:: console
  213. $ glances
  214. For the Web server mode, run:
  215. .. code-block:: console
  216. $ glances -w
  217. and enter the URL ``http://<ip>:61208`` in your favorite web browser.
  218. For the client/server mode, run:
  219. .. code-block:: console
  220. $ glances -s
  221. on the server side and run:
  222. .. code-block:: console
  223. $ glances -c <ip>
  224. on the client one.
  225. You can also detect and display all Glances servers available on your
  226. network or defined in the configuration file:
  227. .. code-block:: console
  228. $ glances --browser
  229. and RTFM, always.
  230. Documentation
  231. =============
  232. For complete documentation have a look at the readthedocs_ website.
  233. If you have any question (after RTFM!), please post it on the official Q&A `forum`_.
  234. Gateway to other services
  235. =========================
  236. Glances can export stats to: ``CSV`` file, ``JSON`` file, ``InfluxDB``, ``Cassandra``, ``CouchDB``,
  237. ``OpenTSDB``, ``Prometheus``, ``StatsD``, ``ElasticSearch``, ``RabbitMQ/ActiveMQ``,
  238. ``ZeroMQ``, ``Kafka``, ``Riemann`` and ``RESTful`` server.
  239. How to contribute ?
  240. ===================
  241. If you want to contribute to the Glances project, read this `wiki`_ page.
  242. There is also a chat dedicated to the Glances developers:
  243. .. image:: https://badges.gitter.im/Join%20Chat.svg
  244. :target: https://gitter.im/nicolargo/glances?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
  245. Author
  246. ======
  247. Nicolas Hennion (@nicolargo) <nicolas@nicolargo.com>
  248. License
  249. =======
  250. LGPLv3. See ``COPYING`` for more details.
  251. .. _psutil: https://github.com/giampaolo/psutil
  252. .. _glancesautoinstall: https://github.com/nicolargo/glancesautoinstall
  253. .. _@nicolargo: https://twitter.com/nicolargo
  254. .. _Python: https://www.python.org/getit/
  255. .. _Termux: https://play.google.com/store/apps/details?id=com.termux
  256. .. _readthedocs: https://glances.readthedocs.io/
  257. .. _forum: https://groups.google.com/forum/?hl=en#!forum/glances-users
  258. .. _wiki: https://github.com/nicolargo/glances/wiki/How-to-contribute-to-Glances-%3F