Use Sphinx for doc
@ -15,5 +15,5 @@ include glances/outputs/static/js/vendors/*.js
|
||||
include glances/outputs/static/js/vendors/*.js.map
|
||||
include glances/outputs/static/images/*.png
|
||||
include man/glances.1
|
||||
recursive-include docs images/*.png glances-doc.html
|
||||
recursive-include docs *
|
||||
recursive-include glances *.py
|
||||
|
@ -266,7 +266,7 @@ and RTFM, always.
|
||||
Documentation
|
||||
=============
|
||||
|
||||
For complete documentation see `glances-doc`_.
|
||||
For complete documentation have a look at the readthedocs_ website.
|
||||
|
||||
If you have any question (after RTFM!), please post it on the official Q&A `forum`_.
|
||||
|
||||
@ -301,6 +301,6 @@ LGPL. See ``COPYING`` for more details.
|
||||
.. _@nicolargo: https://twitter.com/nicolargo
|
||||
.. _@glances_system: https://twitter.com/glances_system
|
||||
.. _Python: https://www.python.org/getit/
|
||||
.. _glances-doc: https://github.com/nicolargo/glances/blob/master/docs/glances-doc.rst
|
||||
.. _readthedocs: https://glances.readthedocs.org/
|
||||
.. _forum: https://groups.google.com/forum/?hl=en#!forum/glances-users
|
||||
.. _wiki: https://github.com/nicolargo/glances/wiki/How-to-contribute-to-Glances-%3F
|
||||
|
@ -7,6 +7,11 @@ SPHINXBUILD = sphinx-build
|
||||
PAPER =
|
||||
BUILDDIR = _build
|
||||
|
||||
# User-friendly check for sphinx-build
|
||||
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
|
||||
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
|
||||
endif
|
||||
|
||||
# Internal variables.
|
||||
PAPEROPT_a4 = -D latex_paper_size=a4
|
||||
PAPEROPT_letter = -D latex_paper_size=letter
|
||||
@ -14,8 +19,7 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||
# the i18n builder cannot share the environment and doctrees with the others
|
||||
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||
|
||||
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
|
||||
|
||||
.PHONY: help
|
||||
help:
|
||||
@echo "Please use \`make <target>' where <target> is one of"
|
||||
@echo " html to make standalone HTML files"
|
||||
@ -25,53 +29,66 @@ help:
|
||||
@echo " json to make JSON files"
|
||||
@echo " htmlhelp to make HTML files and a HTML help project"
|
||||
@echo " qthelp to make HTML files and a qthelp project"
|
||||
@echo " applehelp to make an Apple Help Book"
|
||||
@echo " devhelp to make HTML files and a Devhelp project"
|
||||
@echo " epub to make an epub"
|
||||
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
||||
@echo " latexpdf to make LaTeX files and run them through pdflatex"
|
||||
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
|
||||
@echo " text to make text files"
|
||||
@echo " man to make manual pages"
|
||||
@echo " texinfo to make Texinfo files"
|
||||
@echo " info to make Texinfo files and run them through makeinfo"
|
||||
@echo " gettext to make PO message catalogs"
|
||||
@echo " changes to make an overview of all changed/added/deprecated items"
|
||||
@echo " xml to make Docutils-native XML files"
|
||||
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
|
||||
@echo " linkcheck to check all external links for integrity"
|
||||
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
|
||||
@echo " coverage to run coverage check of the documentation (if enabled)"
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
-rm -rf $(BUILDDIR)/*
|
||||
rm -rf $(BUILDDIR)/*
|
||||
|
||||
.PHONY: html
|
||||
html:
|
||||
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
||||
|
||||
.PHONY: dirhtml
|
||||
dirhtml:
|
||||
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
||||
|
||||
.PHONY: singlehtml
|
||||
singlehtml:
|
||||
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
|
||||
|
||||
.PHONY: pickle
|
||||
pickle:
|
||||
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
|
||||
@echo
|
||||
@echo "Build finished; now you can process the pickle files."
|
||||
|
||||
.PHONY: json
|
||||
json:
|
||||
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
|
||||
@echo
|
||||
@echo "Build finished; now you can process the JSON files."
|
||||
|
||||
.PHONY: htmlhelp
|
||||
htmlhelp:
|
||||
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run HTML Help Workshop with the" \
|
||||
".hhp project file in $(BUILDDIR)/htmlhelp."
|
||||
|
||||
.PHONY: qthelp
|
||||
qthelp:
|
||||
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
|
||||
@echo
|
||||
@ -81,6 +98,16 @@ qthelp:
|
||||
@echo "To view the help file:"
|
||||
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Glances.qhc"
|
||||
|
||||
.PHONY: applehelp
|
||||
applehelp:
|
||||
$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
|
||||
@echo
|
||||
@echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
|
||||
@echo "N.B. You won't be able to view it unless you put it in" \
|
||||
"~/Library/Documentation/Help or install it in your application" \
|
||||
"bundle."
|
||||
|
||||
.PHONY: devhelp
|
||||
devhelp:
|
||||
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
|
||||
@echo
|
||||
@ -90,11 +117,13 @@ devhelp:
|
||||
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Glances"
|
||||
@echo "# devhelp"
|
||||
|
||||
.PHONY: epub
|
||||
epub:
|
||||
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
|
||||
@echo
|
||||
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
|
||||
|
||||
.PHONY: latex
|
||||
latex:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo
|
||||
@ -102,22 +131,33 @@ latex:
|
||||
@echo "Run \`make' in that directory to run these through (pdf)latex" \
|
||||
"(use \`make latexpdf' here to do that automatically)."
|
||||
|
||||
.PHONY: latexpdf
|
||||
latexpdf:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo "Running LaTeX files through pdflatex..."
|
||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf
|
||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||
|
||||
.PHONY: latexpdfja
|
||||
latexpdfja:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo "Running LaTeX files through platex and dvipdfmx..."
|
||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
|
||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||
|
||||
.PHONY: text
|
||||
text:
|
||||
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
|
||||
@echo
|
||||
@echo "Build finished. The text files are in $(BUILDDIR)/text."
|
||||
|
||||
.PHONY: man
|
||||
man:
|
||||
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
|
||||
@echo
|
||||
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
|
||||
|
||||
.PHONY: texinfo
|
||||
texinfo:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo
|
||||
@ -125,29 +165,52 @@ texinfo:
|
||||
@echo "Run \`make' in that directory to run these through makeinfo" \
|
||||
"(use \`make info' here to do that automatically)."
|
||||
|
||||
.PHONY: info
|
||||
info:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo "Running Texinfo files through makeinfo..."
|
||||
make -C $(BUILDDIR)/texinfo info
|
||||
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
|
||||
|
||||
.PHONY: gettext
|
||||
gettext:
|
||||
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
|
||||
@echo
|
||||
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
|
||||
|
||||
.PHONY: changes
|
||||
changes:
|
||||
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
|
||||
@echo
|
||||
@echo "The overview file is in $(BUILDDIR)/changes."
|
||||
|
||||
.PHONY: linkcheck
|
||||
linkcheck:
|
||||
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
|
||||
@echo
|
||||
@echo "Link check complete; look for any errors in the above output " \
|
||||
"or in $(BUILDDIR)/linkcheck/output.txt."
|
||||
|
||||
.PHONY: doctest
|
||||
doctest:
|
||||
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
|
||||
@echo "Testing of doctests in the sources finished, look at the " \
|
||||
"results in $(BUILDDIR)/doctest/output.txt."
|
||||
|
||||
.PHONY: coverage
|
||||
coverage:
|
||||
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
|
||||
@echo "Testing of coverage in the sources finished, look at the " \
|
||||
"results in $(BUILDDIR)/coverage/python.txt."
|
||||
|
||||
.PHONY: xml
|
||||
xml:
|
||||
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
|
||||
@echo
|
||||
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
|
||||
|
||||
.PHONY: pseudoxml
|
||||
pseudoxml:
|
||||
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
|
||||
@echo
|
||||
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
|
||||
|
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
0
docs/images/cpu.png → docs/_static/cpu.png
vendored
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 9.8 KiB After Width: | Height: | Size: 9.8 KiB |
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
0
docs/images/fs.png → docs/_static/fs.png
vendored
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 287 KiB After Width: | Height: | Size: 287 KiB |
BIN
docs/_static/grafana.png
vendored
Normal file
After Width: | Height: | Size: 160 KiB |
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 9.0 KiB |
0
docs/images/load.png → docs/_static/load.png
vendored
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
0
docs/images/logs.png → docs/_static/logs.png
vendored
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
0
docs/images/mem.png → docs/_static/mem.png
vendored
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 83 KiB |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 222 KiB After Width: | Height: | Size: 222 KiB |
Before Width: | Height: | Size: 148 KiB After Width: | Height: | Size: 148 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
0
docs/images/raid.png → docs/_static/raid.png
vendored
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
BIN
docs/_static/screenshot-web.png
vendored
Normal file
After Width: | Height: | Size: 259 KiB |
BIN
docs/_static/screenshot-web2.png
vendored
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
docs/_static/screenshot-wide.png
vendored
Normal file
After Width: | Height: | Size: 594 KiB |
Before Width: | Height: | Size: 496 KiB After Width: | Height: | Size: 496 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
7
docs/_templates/links.html
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
<h3>Useful Links</h3>
|
||||
<ul>
|
||||
<li><a href="https://pypi.python.org/pypi/Glances">Glances @ PyPI</a></li>
|
||||
<li><a href="https://github.com/nicolargo/glances">Glances @ GitHub</a></li>
|
||||
<li><a href="https://github.com/nicolargo/glances/issues">Issue Tracker</a></li>
|
||||
<li><a href="https://groups.google.com/forum/#!forum/glances-users">Forum</a></li>
|
||||
</ul>
|
34
docs/aoa/actions.rst
Normal file
@ -0,0 +1,34 @@
|
||||
.. _actions:
|
||||
|
||||
Actions
|
||||
=======
|
||||
|
||||
Glances can trigger actions on events.
|
||||
|
||||
By ``action``, we mean all shell command line. For example, if you want
|
||||
to execute the ``foo.py`` script if the last 5 minutes load are critical
|
||||
then add the ``_action`` line to the Glances configuration file:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[load]
|
||||
critical=5.0
|
||||
critical_action=python /path/to/foo.py
|
||||
|
||||
All the stats are available in the command line through the use of the
|
||||
`{{mustache}}`_ syntax. Another example would be to create a log file
|
||||
containing used vs total disk space if a space trigger warning is
|
||||
reached:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[fs]
|
||||
warning=70
|
||||
warning_action=echo {{mnt_point}} {{used}}/{{size}} > /tmp/fs.alert
|
||||
|
||||
.. note::
|
||||
You can use all the stats for the current plugin. See
|
||||
https://github.com/nicolargo/glances/wiki/The-Glances-2.x-API-How-to
|
||||
for the stats list.
|
||||
|
||||
.. _{{mustache}}: https://mustache.github.io/
|
41
docs/aoa/cpu.rst
Normal file
@ -0,0 +1,41 @@
|
||||
.. _cpu:
|
||||
|
||||
CPU
|
||||
===
|
||||
|
||||
The CPU stats are shown as a percentage and for the configured refresh
|
||||
time. The total CPU usage is displayed on the first line.
|
||||
|
||||
.. image:: ../_static/cpu.png
|
||||
|
||||
If enough horizontal space is available, extended CPU information are
|
||||
displayed.
|
||||
|
||||
.. image:: ../_static/cpu-wide.png
|
||||
|
||||
To switch to per-CPU stats, just hit the ``1`` key:
|
||||
|
||||
.. image:: ../_static/per-cpu.png
|
||||
|
||||
By default, ``steal`` CPU time alerts aren't logged. If you want that,
|
||||
just add to the configuration file:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[cpu]
|
||||
steal_log=True
|
||||
|
||||
Legend:
|
||||
|
||||
================= ============
|
||||
CPU (user/system) Status
|
||||
================= ============
|
||||
``<50%`` ``OK``
|
||||
``>50%`` ``CAREFUL``
|
||||
``>70%`` ``WARNING``
|
||||
``>90%`` ``CRITICAL``
|
||||
================= ============
|
||||
|
||||
.. note::
|
||||
Limit values can be overwritten in the configuration file under
|
||||
the ``[cpu]`` and/or ``[percpu]`` sections.
|
26
docs/aoa/disk.rst
Normal file
@ -0,0 +1,26 @@
|
||||
.. _disk:
|
||||
|
||||
Disk I/O
|
||||
========
|
||||
|
||||
.. image:: ../_static/diskio.png
|
||||
|
||||
Glances displays the disk I/O throughput. The unit is adapted
|
||||
dynamically.
|
||||
|
||||
There is no alert on this information.
|
||||
|
||||
It's possible to define:
|
||||
|
||||
- a list of disks to hide
|
||||
- aliases for disk name
|
||||
|
||||
under the ``[diskio]`` section in the configuration file.
|
||||
|
||||
For example, if you want to hide the loopback disks (loop0, loop1, ...)
|
||||
and the specific ``sda5`` partition:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[diskio]
|
||||
hide=sda5,loop.*
|
11
docs/aoa/docker.rst
Normal file
@ -0,0 +1,11 @@
|
||||
.. _docker:
|
||||
|
||||
Docker
|
||||
======
|
||||
|
||||
If you use ``Docker``, Glances can help you to monitor your containers.
|
||||
Glances uses the Docker API through the `docker-py`_ library.
|
||||
|
||||
.. image:: ../_static/docker.png
|
||||
|
||||
.. _docker-py: https://github.com/docker/docker-py
|
34
docs/aoa/folders.rst
Normal file
@ -0,0 +1,34 @@
|
||||
.. _folders:
|
||||
|
||||
Folders
|
||||
=======
|
||||
|
||||
The folders plugin allows user, through the configuration file, to
|
||||
monitor size of a predefined folders list.
|
||||
|
||||
.. image:: ../_static/folders.png
|
||||
|
||||
Each item is defined by:
|
||||
|
||||
- ``path``: absolute path to monitor (mandatory)
|
||||
- ``careful``: optional careful threshold (in MB)
|
||||
- ``warning``: optional warning threshold (in MB)
|
||||
- ``critical``: optional critical threshold (in MB)
|
||||
|
||||
Up to ``10`` items can be defined.
|
||||
|
||||
For example, if you want to monitor the ``/tmp`` folder, the following
|
||||
definition should do the job:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[folders]
|
||||
folder_1_path=/tmp
|
||||
folder_1_careful=2500
|
||||
folder_1_warning=3000
|
||||
folder_1_critical=3500
|
||||
|
||||
In client/server mode, the list is defined on the ``server`` side.
|
||||
|
||||
.. warning::
|
||||
Do **NOT** define folders containing lot of files and subfolders.
|
55
docs/aoa/fs.rst
Normal file
@ -0,0 +1,55 @@
|
||||
.. _fs:
|
||||
|
||||
File System
|
||||
===========
|
||||
|
||||
.. image:: ../_static/fs.png
|
||||
|
||||
Glances displays the used and total file system disk space. The unit is
|
||||
adapted dynamically.
|
||||
|
||||
Alerts are set for used disk space.
|
||||
|
||||
Legend:
|
||||
|
||||
=========== ============
|
||||
Disk usage Status
|
||||
=========== ============
|
||||
``<50%`` ``OK``
|
||||
``>50%`` ``CAREFUL``
|
||||
``>70%`` ``WARNING``
|
||||
``>90%`` ``CRITICAL``
|
||||
=========== ============
|
||||
|
||||
.. note::
|
||||
Limit values can be overwritten in the configuration file under
|
||||
the ``[filesystem]`` section.
|
||||
|
||||
By default, the plugin only displays physical devices (hard disks, USB
|
||||
keys). To allow other file system types, you have to enable them in the
|
||||
configuration file. For example, if you want to allow the ``zfs`` file
|
||||
system:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[fs]
|
||||
allow=zfs
|
||||
|
||||
Also, you can hide mount points as well (in the following ``/boot``):
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[fs]
|
||||
hide=/boot.*
|
||||
|
||||
RAID
|
||||
----
|
||||
|
||||
*Availability: Linux*
|
||||
|
||||
Thanks to the `pymdstat`_ library, if a ``RAID`` controller is detected
|
||||
on you system, its status will be displayed as well:
|
||||
|
||||
.. image:: ../_static/raid.png
|
||||
|
||||
.. _pymdstat: https://github.com/nicolargo/pymdstat
|
20
docs/aoa/header.rst
Normal file
@ -0,0 +1,20 @@
|
||||
.. _header:
|
||||
|
||||
Header
|
||||
======
|
||||
|
||||
.. image:: ../_static/header.png
|
||||
|
||||
The header shows the hostname, OS name, release version, platform
|
||||
architecture and system uptime (on the upper right corner).
|
||||
Additionally, on GNU/Linux, it also shows the kernel version.
|
||||
|
||||
In client mode, the server connection status is also displayed.
|
||||
|
||||
**Connected**:
|
||||
|
||||
.. image:: ../_static/connected.png
|
||||
|
||||
**Disconnected**:
|
||||
|
||||
.. image:: ../_static/disconnected.png
|
37
docs/aoa/index.rst
Normal file
@ -0,0 +1,37 @@
|
||||
.. _aoa:
|
||||
|
||||
Anatomy Of The Application
|
||||
==========================
|
||||
|
||||
This document is meant to give an overview of the Glances interface.
|
||||
|
||||
Legend:
|
||||
|
||||
=========== ============
|
||||
``GREEN`` ``OK``
|
||||
``BLUE`` ``CAREFUL``
|
||||
``MAGENTA`` ``WARNING``
|
||||
``RED`` ``CRITICAL``
|
||||
=========== ============
|
||||
|
||||
.. note::
|
||||
Only stats with colored background will be shown in the alert view.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
header
|
||||
quicklook
|
||||
cpu
|
||||
load
|
||||
memory
|
||||
network
|
||||
disk
|
||||
fs
|
||||
folders
|
||||
sensors
|
||||
ps
|
||||
monitor
|
||||
logs
|
||||
docker
|
||||
actions
|
35
docs/aoa/load.rst
Normal file
@ -0,0 +1,35 @@
|
||||
.. _load:
|
||||
|
||||
Load
|
||||
====
|
||||
|
||||
*Availability: Unix*
|
||||
|
||||
.. image:: ../_static/load.png
|
||||
|
||||
On the *No Sheep* blog, Zachary Tirrell defines the `load average`_:
|
||||
|
||||
"In short it is the average sum of the number of processes
|
||||
waiting in the run-queue plus the number currently executing
|
||||
over 1, 5, and 15 minutes time periods."
|
||||
|
||||
Glances gets the number of CPU core to adapt the alerts.
|
||||
Alerts on load average are only set on 15 minutes time period.
|
||||
The first line also displays the number of CPU core.
|
||||
|
||||
Legend:
|
||||
|
||||
============= ============
|
||||
Load avg Status
|
||||
============= ============
|
||||
``<0.7*core`` ``OK``
|
||||
``>0.7*core`` ``CAREFUL``
|
||||
``>1*core`` ``WARNING``
|
||||
``>5*core`` ``CRITICAL``
|
||||
============= ============
|
||||
|
||||
.. note::
|
||||
Limit values can be overwritten in the configuration file under
|
||||
the ``[load]`` section.
|
||||
|
||||
.. _load average: http://nosheep.net/story/defining-unix-load-average/
|
21
docs/aoa/logs.rst
Normal file
@ -0,0 +1,21 @@
|
||||
.. _logs:
|
||||
|
||||
Logs
|
||||
====
|
||||
|
||||
.. image:: ../_static/logs.png
|
||||
|
||||
A log messages list is displayed in the bottom of the screen if and only
|
||||
if:
|
||||
|
||||
- at least one ``WARNING`` or ``CRITICAL`` alert was occurred
|
||||
- space is available in the bottom of the console/terminal
|
||||
|
||||
Each alert message displays the following information:
|
||||
|
||||
1. start datetime
|
||||
2. duration if alert is terminated or `ongoing` if the alert is still in
|
||||
progress
|
||||
3. alert name
|
||||
4. {min,avg,max} values or number of running processes for monitored
|
||||
processes list alerts
|
30
docs/aoa/memory.rst
Normal file
@ -0,0 +1,30 @@
|
||||
.. _memory:
|
||||
|
||||
Memory
|
||||
======
|
||||
|
||||
Glances uses two columns: one for the ``RAM`` and one for the ``SWAP``.
|
||||
|
||||
.. image:: ../_static/mem.png
|
||||
|
||||
If enough space is available, Glances displays extended information for
|
||||
the ``RAM``:
|
||||
|
||||
.. image:: ../_static/mem-wide.png
|
||||
|
||||
Alerts are only set for used memory and used swap.
|
||||
|
||||
Legend:
|
||||
|
||||
======== ============
|
||||
RAM/Swap Status
|
||||
======== ============
|
||||
``<50%`` ``OK``
|
||||
``>50%`` ``CAREFUL``
|
||||
``>70%`` ``WARNING``
|
||||
``>90%`` ``CRITICAL``
|
||||
======== ============
|
||||
|
||||
.. note::
|
||||
Limit values can be overwritten in the configuration file under
|
||||
the ``[memory]`` and/or ``[memswap]`` sections.
|
65
docs/aoa/monitor.rst
Normal file
@ -0,0 +1,65 @@
|
||||
.. _monitor:
|
||||
|
||||
Monitored Processes List
|
||||
========================
|
||||
|
||||
The monitored processes list allows user, through the configuration
|
||||
file, to group processes and quickly show if the number of running
|
||||
processes is not good.
|
||||
|
||||
.. image:: ../_static/monitored.png
|
||||
|
||||
Each item is defined by:
|
||||
|
||||
- ``description``: description of the processes (max 16 chars).
|
||||
- ``regex``: regular expression of the processes to monitor.
|
||||
- ``command``: (optional) full path to shell command/script for extended
|
||||
- stat. Should return a single line string. Use with caution.
|
||||
- ``countmin``: (optional) minimal number of processes. A warning will
|
||||
- be displayed if number of processes < count.
|
||||
- ``countmax``: (optional) maximum number of processes. A warning will
|
||||
be displayed if number of processes > count.
|
||||
|
||||
Up to ``10`` items can be defined.
|
||||
|
||||
For example, if you want to monitor the Nginx processes on a web server,
|
||||
the following definition should do the job:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[monitor]
|
||||
list_1_description=Nginx server
|
||||
list_1_regex=.*nginx.*
|
||||
list_1_command=nginx -v
|
||||
list_1_countmin=1
|
||||
list_1_countmax=4
|
||||
|
||||
If you also want to monitor the PHP-FPM daemon processes, you should add
|
||||
another item:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[monitor]
|
||||
list_1_description=Nginx server
|
||||
list_1_regex=.*nginx.*
|
||||
list_1_command=nginx -v
|
||||
list_1_countmin=1
|
||||
list_1_countmax=4
|
||||
list_2_description=PHP-FPM
|
||||
list_2_regex=.*php-fpm.*
|
||||
list_2_countmin=1
|
||||
list_2_countmax=20
|
||||
|
||||
In client/server mode, the list is defined on the server side.
|
||||
A new method, called `getAllMonitored`, is available in the APIs and
|
||||
get the JSON representation of the monitored processes list.
|
||||
|
||||
Alerts are set as following:
|
||||
|
||||
================= ============
|
||||
# of process Status
|
||||
================= ============
|
||||
``0`` ``CRITICAL``
|
||||
``min < p < max`` ``OK``
|
||||
``p > max`` ``WARNING``
|
||||
================= ============
|
28
docs/aoa/network.rst
Normal file
@ -0,0 +1,28 @@
|
||||
.. _network:
|
||||
|
||||
Network
|
||||
=======
|
||||
|
||||
.. image:: ../_static/network.png
|
||||
|
||||
Glances displays the network interface bit rate. The unit is adapted
|
||||
dynamically (bit/s, kbit/s, Mbit/s, etc).
|
||||
|
||||
Alerts are only set if the maximum speed per network interface is
|
||||
available (see sample in the configuration file).
|
||||
|
||||
It's also possibile to define:
|
||||
|
||||
- a list of network interfaces to hide
|
||||
- per-interface limit values
|
||||
- aliases for interface name
|
||||
|
||||
in the ``[network]`` section of the configuration file.
|
||||
|
||||
For example, if you want to hide the loopback interface (lo) and all the
|
||||
virtual docker interface (docker0, docker1, ...):
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[network]
|
||||
hide=lo,docker.*
|
107
docs/aoa/ps.rst
Normal file
@ -0,0 +1,107 @@
|
||||
.. _ps:
|
||||
|
||||
Processes List
|
||||
==============
|
||||
|
||||
Compact view:
|
||||
|
||||
.. image:: ../_static/processlist.png
|
||||
|
||||
Full view:
|
||||
|
||||
.. image:: ../_static/processlist-wide.png
|
||||
|
||||
Filtered view:
|
||||
|
||||
.. image:: ../_static/processlist-filter.png
|
||||
|
||||
The process view consists of 3 parts:
|
||||
|
||||
- Processes summary
|
||||
- Monitored processes list (optional)
|
||||
- Processes list
|
||||
|
||||
The processes summary line displays:
|
||||
|
||||
- Tasks number (total number of processes)
|
||||
- Threads number
|
||||
- Running tasks number
|
||||
- Sleeping tasks number
|
||||
- Other tasks number (not running or sleeping)
|
||||
- Sort key
|
||||
|
||||
By default, or if you hit the ``a`` key, the processes list is
|
||||
automatically sorted by:
|
||||
|
||||
- ``CPU``: if there is no alert (default behavior)
|
||||
- ``CPU``: if a CPU or LOAD alert is detected
|
||||
- ``MEM``: if a memory alert is detected
|
||||
- ``DISK I/O``: if a CPU iowait alert is detected
|
||||
|
||||
The number of processes in the list is adapted to the screen size.
|
||||
|
||||
Columns display
|
||||
---------------
|
||||
|
||||
========================= ==============================================
|
||||
``CPU%`` % of CPU used by the process
|
||||
|
||||
If Irix/Solaris mode is off, the value is
|
||||
divided by logical core number
|
||||
``MEM%`` % of MEM used by the process
|
||||
``VIRT`` Virtual Memory Size
|
||||
|
||||
The total amount of virtual memory used by the
|
||||
process
|
||||
``RES`` Resident Memory Size
|
||||
|
||||
The non-swapped physical memory a process is
|
||||
using
|
||||
``PID`` Process ID
|
||||
``USER`` User ID
|
||||
``NI`` Nice level of the process
|
||||
``S`` Process status
|
||||
|
||||
The status of the process:
|
||||
|
||||
- ``R``: running
|
||||
- ``S``: sleeping (may be interrupted)
|
||||
- ``D``: disk sleep (may not be interrupted)
|
||||
- ``T``: traced/stopped
|
||||
- ``Z``: zombie
|
||||
|
||||
``TIME+`` Cumulative CPU time used by the process
|
||||
``R/s`` Per process I/O read rate in B/s
|
||||
``W/s`` Per process I/O write rate in B/s
|
||||
``COMMAND`` Process command line or command name
|
||||
|
||||
User can switch to the process name by
|
||||
pressing on the ``'/'`` key
|
||||
========================= ==============================================
|
||||
|
||||
Extended info
|
||||
-------------
|
||||
|
||||
.. image:: ../_static/processlist-top.png
|
||||
|
||||
In standalone mode, additional information are provided for the top
|
||||
process:
|
||||
|
||||
========================= ==============================================
|
||||
``CPU affinity`` Number of cores used by the process
|
||||
``Memory info`` Extended memory information about the process
|
||||
|
||||
For example, on Linux: swap, shared, text,
|
||||
lib, data and dirty
|
||||
``Open`` The number of threads, files and network
|
||||
sessions (TCP and UDP) used by the process
|
||||
``IO nice`` The process I/O niceness (priority)
|
||||
========================= ==============================================
|
||||
|
||||
The extended stats feature can be enabled using the
|
||||
``--enable-process-extended`` option (command line) or the ``e`` key
|
||||
(curses interface).
|
||||
|
||||
.. note::
|
||||
Limit values can be overwritten in the configuration file under
|
||||
the ``[process]`` section.
|
17
docs/aoa/quicklook.rst
Normal file
@ -0,0 +1,17 @@
|
||||
.. _quicklook:
|
||||
|
||||
Quick Look
|
||||
==========
|
||||
|
||||
The ``quicklook`` plugin is only displayed on wide screen and proposes a
|
||||
bar view for CPU and memory (virtual and swap).
|
||||
|
||||
.. image:: ../_static/quicklook.png
|
||||
|
||||
If the per CPU mode is on (by clicking the ``1`` key):
|
||||
|
||||
.. image:: ../_static/quicklook-percpu.png
|
||||
|
||||
.. note::
|
||||
Limit values can be overwritten in the configuration file under
|
||||
the ``[quicklook]`` section.
|
24
docs/aoa/sensors.rst
Normal file
@ -0,0 +1,24 @@
|
||||
.. _sensors:
|
||||
|
||||
Sensors
|
||||
=======
|
||||
|
||||
*Availability: Linux*
|
||||
|
||||
.. image:: ../_static/sensors.png
|
||||
|
||||
Glances can displays the sensors information using ``lm-sensors``,
|
||||
``hddtemp`` and `batinfo`_.
|
||||
|
||||
All of the above libraries are available only on Linux.
|
||||
|
||||
As of ``lm-sensors``, a filter is being applied in order to display
|
||||
temperature and fan speed only.
|
||||
|
||||
There is no alert on this information.
|
||||
|
||||
.. note::
|
||||
Limit values and sensors alias names can be defined in the
|
||||
configuration file under the ``[sensors]`` section.
|
||||
|
||||
.. _batinfo: https://github.com/nicolargo/batinfo
|
15
docs/api.rst
Normal file
@ -0,0 +1,15 @@
|
||||
.. _api:
|
||||
|
||||
API Documentation
|
||||
=================
|
||||
|
||||
Glances provides an `XML-RPC server`_ and a `RESTful-JSON`_ API which
|
||||
can be used by other clients.
|
||||
|
||||
API documentation is available at:
|
||||
|
||||
- XML-RPC: https://github.com/nicolargo/glances/wiki/The-Glances-2.x-API-How-to
|
||||
- RESTful-JSON: https://github.com/nicolargo/glances/wiki/The-Glances-RESTFULL-JSON-API
|
||||
|
||||
.. _XML-RPC server: http://docs.python.org/2/library/simplexmlrpcserver.html
|
||||
.. _RESTful-JSON: http://jsonapi.org/
|
413
docs/cmds.rst
Normal file
@ -0,0 +1,413 @@
|
||||
.. _cmds:
|
||||
|
||||
Command Reference
|
||||
=================
|
||||
|
||||
Command-Line Options
|
||||
--------------------
|
||||
|
||||
.. option:: -h, --help
|
||||
|
||||
show this help message and exit
|
||||
|
||||
.. option:: -V, --version
|
||||
|
||||
show program's version number and exit
|
||||
|
||||
.. option:: -d, --debug
|
||||
|
||||
enable debug mode
|
||||
|
||||
.. option:: -C CONF_FILE, --config CONF_FILE
|
||||
|
||||
path to the configuration file
|
||||
|
||||
.. option:: -3, --disable-quicklook
|
||||
|
||||
disable quick look module
|
||||
|
||||
.. option:: -4, --full-quicklook
|
||||
|
||||
disable all but quick look and load
|
||||
|
||||
.. option:: --disable-cpu
|
||||
|
||||
disable CPU module
|
||||
|
||||
.. option:: --disable-mem
|
||||
|
||||
disable memory module
|
||||
|
||||
.. option:: --disable-swap
|
||||
|
||||
disable swap module
|
||||
|
||||
.. option:: --disable-load
|
||||
|
||||
disable load module
|
||||
|
||||
.. option:: --disable-network
|
||||
|
||||
disable network module
|
||||
|
||||
.. option:: --disable-ip
|
||||
|
||||
disable IP module
|
||||
|
||||
.. option:: --disable-diskio
|
||||
|
||||
disable disk I/O module
|
||||
|
||||
.. option:: --disable-fs
|
||||
|
||||
disable filesystem module
|
||||
|
||||
.. option:: --disable-folder
|
||||
|
||||
disable folder module
|
||||
|
||||
.. option:: --disable-sensors
|
||||
|
||||
disable sensors module
|
||||
|
||||
.. option:: --disable-hddtemp
|
||||
|
||||
disable HD temperature module
|
||||
|
||||
.. option:: --disable-raid
|
||||
|
||||
disable RAID module
|
||||
|
||||
.. option:: --disable-docker
|
||||
|
||||
disable Docker module
|
||||
|
||||
.. option:: -5, --disable-top
|
||||
|
||||
disable top menu (QuickLook, CPU, MEM, SWAP and LOAD)
|
||||
|
||||
.. option:: -2, --disable-left-sidebar
|
||||
|
||||
disable network, disk I/O, FS and sensors modules (py3sensors lib
|
||||
needed)
|
||||
|
||||
.. option:: --disable-process
|
||||
|
||||
disable process module
|
||||
|
||||
.. option:: --disable-log
|
||||
|
||||
disable log module
|
||||
|
||||
.. option:: --disable-bold
|
||||
|
||||
disable bold mode in the terminal
|
||||
|
||||
.. option:: --disable-bg
|
||||
|
||||
disable background colors in the terminal
|
||||
|
||||
.. option:: --enable-process-extended
|
||||
|
||||
enable extended stats on top process
|
||||
|
||||
.. option:: --enable-history
|
||||
|
||||
enable the history mode (matplotlib lib needed)
|
||||
|
||||
.. option:: --path-history PATH_HISTORY
|
||||
|
||||
set the export path for graph history
|
||||
|
||||
.. option:: --export-csv EXPORT_CSV
|
||||
|
||||
export stats to a CSV file
|
||||
|
||||
.. option:: --export-influxdb
|
||||
|
||||
export stats to an InfluxDB server (influxdb lib needed)
|
||||
|
||||
.. option:: --export-opentsdb
|
||||
|
||||
export stats to an OpenTSDB server (potsdb lib needed)
|
||||
|
||||
.. option:: --export-statsd
|
||||
|
||||
export stats to a StatsD server (statsd lib needed)
|
||||
|
||||
.. option:: --export-rabbitmq
|
||||
|
||||
export stats to RabbitMQ broker (pika lib needed)
|
||||
|
||||
.. option:: --export-elasticsearch
|
||||
|
||||
export stats to an Elasticsearch server (elasticsearch lib needed)
|
||||
|
||||
.. option:: -c CLIENT, --client CLIENT
|
||||
|
||||
connect to a Glances server by IPv4/IPv6 address or hostname
|
||||
|
||||
.. option:: -s, --server
|
||||
|
||||
run Glances in server mode
|
||||
|
||||
.. option:: --browser
|
||||
|
||||
start the client browser (list of servers)
|
||||
|
||||
.. option:: --disable-autodiscover
|
||||
|
||||
disable autodiscover feature
|
||||
|
||||
.. option:: -p PORT, --port PORT
|
||||
|
||||
define the client/server TCP port [default: 61209]
|
||||
|
||||
.. option:: -B BIND_ADDRESS, --bind BIND_ADDRESS
|
||||
|
||||
bind server to the given IPv4/IPv6 address or hostname
|
||||
|
||||
.. option:: --username
|
||||
|
||||
define a client/server username
|
||||
|
||||
.. option:: --password
|
||||
|
||||
define a client/server password
|
||||
|
||||
.. option:: --snmp-community SNMP_COMMUNITY
|
||||
|
||||
SNMP community
|
||||
|
||||
.. option:: --snmp-port SNMP_PORT
|
||||
|
||||
SNMP port
|
||||
|
||||
.. option:: --snmp-version SNMP_VERSION
|
||||
|
||||
SNMP version (1, 2c or 3)
|
||||
|
||||
.. option:: --snmp-user SNMP_USER
|
||||
|
||||
SNMP username (only for SNMPv3)
|
||||
|
||||
.. option:: --snmp-auth SNMP_AUTH
|
||||
|
||||
SNMP authentication key (only for SNMPv3)
|
||||
|
||||
.. option:: --snmp-force
|
||||
|
||||
force SNMP mode
|
||||
|
||||
.. option:: -t TIME, --time TIME
|
||||
|
||||
set refresh time in seconds [default: 3 sec]
|
||||
|
||||
.. option:: -w, --webserver
|
||||
|
||||
run Glances in web server mode (bottle lib needed)
|
||||
|
||||
.. option:: -q, --quiet
|
||||
|
||||
do not display the curses interface
|
||||
|
||||
.. option:: -f PROCESS_FILTER, --process-filter PROCESS_FILTER
|
||||
|
||||
set the process filter pattern (regular expression)
|
||||
|
||||
.. option:: --process-short-name
|
||||
|
||||
force short name for processes name
|
||||
|
||||
.. option:: -0, --disable-irix
|
||||
|
||||
task's CPU usage will be divided by the total number of CPUs
|
||||
|
||||
.. option:: --hide-kernel-threads
|
||||
|
||||
hide kernel threads in process list
|
||||
|
||||
.. option:: --tree
|
||||
|
||||
display processes as a tree
|
||||
|
||||
.. option:: -b, --byte
|
||||
|
||||
display network rate in byte per second
|
||||
|
||||
.. option:: --diskio-show-ramfs
|
||||
|
||||
show RAM FS in the DiskIO plugin
|
||||
|
||||
.. option:: --diskio-iops
|
||||
|
||||
show I/O per second in the DiskIO plugin
|
||||
|
||||
.. option:: --fahrenheit
|
||||
|
||||
display temperature in Fahrenheit (default is Celsius)
|
||||
|
||||
.. option:: -1, --percpu
|
||||
|
||||
start Glances in per CPU mode
|
||||
|
||||
.. option:: --fs-free-space
|
||||
|
||||
display FS free space instead of used
|
||||
|
||||
.. option:: --theme-white
|
||||
|
||||
optimize display colors for white background
|
||||
|
||||
Interactive Commands
|
||||
--------------------
|
||||
|
||||
The following commands (key pressed) are supported while in Glances:
|
||||
|
||||
``ENTER``
|
||||
Set the process filter
|
||||
|
||||
**Note**: on OS X, please use ``CTRL-H`` to delete
|
||||
filter.
|
||||
|
||||
Filter is a regular expression pattern:
|
||||
|
||||
- ``gnome``: matches all processes starting with the ``gnome``
|
||||
string
|
||||
|
||||
- ``.*gnome.*``: matches all processes containing the ``gnome``
|
||||
string
|
||||
|
||||
``a``
|
||||
Sort process list automatically
|
||||
|
||||
- If CPU ``>70%``, sort processes by CPU usage
|
||||
|
||||
- If MEM ``>70%``, sort processes by MEM usage
|
||||
|
||||
- If CPU iowait ``>60%``, sort processes by I/O read and write
|
||||
|
||||
``b``
|
||||
Switch between bit/s or Byte/s for network I/O
|
||||
|
||||
``B``
|
||||
View disk I/O counters per second
|
||||
|
||||
``c``
|
||||
Sort processes by CPU usage
|
||||
|
||||
``d``
|
||||
Show/hide disk I/O stats
|
||||
|
||||
``D``
|
||||
Enable/disable Docker stats
|
||||
|
||||
``e``
|
||||
Enable/disable top extended stats
|
||||
|
||||
``E``
|
||||
Erase current process filter
|
||||
|
||||
``f``
|
||||
Show/hide file system and folder monitoring stats
|
||||
|
||||
``F``
|
||||
Switch between file system used and free space
|
||||
|
||||
``g``
|
||||
Generate graphs for current history
|
||||
|
||||
``h``
|
||||
Show/hide the help screen
|
||||
|
||||
``i``
|
||||
Sort processes by I/O rate
|
||||
|
||||
``I``
|
||||
Show/hide IP module
|
||||
|
||||
``l``
|
||||
Show/hide log messages
|
||||
|
||||
``m``
|
||||
Sort processes by MEM usage
|
||||
|
||||
``M``
|
||||
Reset processes summary min/max
|
||||
|
||||
``n``
|
||||
Show/hide network stats
|
||||
|
||||
``p``
|
||||
Sort processes by name
|
||||
|
||||
``q|ESC``
|
||||
Quit the current Glances session
|
||||
|
||||
``r``
|
||||
Reset history
|
||||
|
||||
``R``
|
||||
Show/hide RAID plugin
|
||||
|
||||
``s``
|
||||
Show/hide sensors stats
|
||||
|
||||
``t``
|
||||
Sort process by CPU times (TIME+)
|
||||
|
||||
``T``
|
||||
View network I/O as combination
|
||||
|
||||
``u``
|
||||
Sort processes by USER
|
||||
|
||||
``U``
|
||||
View cumulative network I/O
|
||||
|
||||
``w``
|
||||
Delete finished warning log messages
|
||||
|
||||
``x``
|
||||
Delete finished warning and critical log messages
|
||||
|
||||
``z``
|
||||
Show/hide processes stats
|
||||
|
||||
``0``
|
||||
Enable/disable Irix/Solaris mode
|
||||
|
||||
Task's CPU usage will be divided by the total number of CPUs
|
||||
|
||||
``1``
|
||||
Switch between global CPU and per-CPU stats
|
||||
|
||||
``2``
|
||||
Enable/disable left sidebar
|
||||
|
||||
``3``
|
||||
Enable/disable the quick look module
|
||||
|
||||
``4``
|
||||
Enable/disable all but quick look and load module
|
||||
|
||||
``5``
|
||||
Enable/disable top menu (QuickLook, CPU, MEM, SWAP and LOAD)
|
||||
|
||||
``/``
|
||||
Switch between process command line or command name
|
||||
|
||||
In the Glances client browser (accessible through the ``--browser``
|
||||
command line argument):
|
||||
|
||||
``ENTER``
|
||||
Run the selected server
|
||||
|
||||
``UP``
|
||||
Up in the servers list
|
||||
|
||||
``DOWN``
|
||||
Down in the servers list
|
||||
|
||||
``q|ESC``
|
||||
Quit Glances
|
139
docs/conf.py
@ -1,9 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Glances documentation build configuration file, created by
|
||||
# sphinx-quickstart on Tue Mar 25 19:57:21 2014.
|
||||
# sphinx-quickstart on Tue Mar 1 10:53:59 2016.
|
||||
#
|
||||
# This file is execfile()d with the current directory set to its containing dir.
|
||||
# This file is execfile()d with the current directory set to its
|
||||
# containing dir.
|
||||
#
|
||||
# Note that not all possible configuration values are present in this
|
||||
# autogenerated file.
|
||||
@ -11,45 +12,33 @@
|
||||
# All configuration values have a default; values that are commented out
|
||||
# serve to show the default.
|
||||
|
||||
import datetime
|
||||
import os
|
||||
# import sys
|
||||
# import os
|
||||
from datetime import datetime
|
||||
|
||||
from glances import __version__
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
#sys.path.insert(0, os.path.abspath('.'))
|
||||
cwd = os.path.realpath(os.path.dirname(__file__))
|
||||
project_path = os.path.realpath(os.path.join(cwd, '..', 'glances'))
|
||||
|
||||
def get_version():
|
||||
init_file = os.path.realpath(os.path.join(project_path, '__init__.py'))
|
||||
f = open(init_file, 'r')
|
||||
try:
|
||||
for line in f:
|
||||
if line.startswith('__version__'):
|
||||
return line.strip().split(' = ')[1]
|
||||
else:
|
||||
raise ValueError("Version string not found")
|
||||
finally:
|
||||
f.close()
|
||||
|
||||
_version = get_version()
|
||||
_year = datetime.datetime.now().year
|
||||
_copyright = u'{0}, Nicolas Hennion'.format(_year)
|
||||
|
||||
# -- General configuration -----------------------------------------------------
|
||||
# -- General configuration ------------------------------------------------
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
#needs_sphinx = '1.0'
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be extensions
|
||||
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = []
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
||||
# The suffix of source filenames.
|
||||
# The suffix(es) of source filenames.
|
||||
# You can specify multiple suffix as a list of string:
|
||||
# source_suffix = ['.rst', '.md']
|
||||
source_suffix = '.rst'
|
||||
|
||||
# The encoding of source files.
|
||||
@ -59,21 +48,26 @@ source_suffix = '.rst'
|
||||
master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = u'Glances'
|
||||
copyright = _copyright
|
||||
project = 'Glances'
|
||||
author = 'Nicolas Hennion'
|
||||
year = datetime.now().year
|
||||
copyright = '%d, %s' % (year, author)
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = _version
|
||||
version = __version__
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = version
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
#language = None
|
||||
#
|
||||
# This is also used if you do content translation via gettext catalogs.
|
||||
# Usually you set "language" from the command line for these cases.
|
||||
language = None
|
||||
|
||||
# There are two options for replacing |today|: either, you set today to some
|
||||
# non-false value, then it is used:
|
||||
@ -85,7 +79,8 @@ release = version
|
||||
# directories to ignore when looking for source files.
|
||||
exclude_patterns = ['_build']
|
||||
|
||||
# The reST default role (used for this markup: `text`) to use for all documents.
|
||||
# The reST default role (used for this markup: `text`) to use for all
|
||||
# documents.
|
||||
#default_role = None
|
||||
|
||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||
@ -105,17 +100,27 @@ pygments_style = 'sphinx'
|
||||
# A list of ignored prefixes for module index sorting.
|
||||
#modindex_common_prefix = []
|
||||
|
||||
# If true, keep warnings as "system message" paragraphs in the built documents.
|
||||
#keep_warnings = False
|
||||
|
||||
# -- Options for HTML output ---------------------------------------------------
|
||||
# If true, `todo` and `todoList` produce output, else they produce nothing.
|
||||
todo_include_todos = False
|
||||
|
||||
|
||||
# -- Options for HTML output ----------------------------------------------
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
html_theme = 'default'
|
||||
html_theme = 'alabaster'
|
||||
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
# documentation.
|
||||
#html_theme_options = {}
|
||||
html_theme_options = {
|
||||
'github_user': 'nicolargo',
|
||||
'github_repo': 'glances',
|
||||
'show_powered_by': False
|
||||
}
|
||||
|
||||
# Add any paths that contain custom themes here, relative to this directory.
|
||||
#html_theme_path = []
|
||||
@ -131,15 +136,20 @@ html_theme = 'default'
|
||||
# of the sidebar.
|
||||
#html_logo = None
|
||||
|
||||
# The name of an image file (within the static path) to use as favicon of the
|
||||
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||
# The name of an image file (relative to this directory) to use as a favicon of
|
||||
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||
# pixels large.
|
||||
#html_favicon = None
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
#html_static_path = ['_static']
|
||||
html_static_path = ['_static']
|
||||
|
||||
# Add any extra paths that contain custom files (such as robots.txt or
|
||||
# .htaccess) here, relative to this directory. These files are copied
|
||||
# directly to the root of the documentation.
|
||||
#html_extra_path = []
|
||||
|
||||
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
||||
# using the given strftime format.
|
||||
@ -150,7 +160,14 @@ html_theme = 'default'
|
||||
#html_use_smartypants = True
|
||||
|
||||
# Custom sidebar templates, maps document names to template names.
|
||||
#html_sidebars = {}
|
||||
html_sidebars = {
|
||||
'**': [
|
||||
'about.html',
|
||||
'navigation.html',
|
||||
'links.html',
|
||||
'searchbox.html'
|
||||
]
|
||||
}
|
||||
|
||||
# Additional templates that should be rendered to pages, maps page names to
|
||||
# template names.
|
||||
@ -166,7 +183,7 @@ html_theme = 'default'
|
||||
#html_split_index = False
|
||||
|
||||
# If true, links to the reST sources are added to the pages.
|
||||
#html_show_sourcelink = True
|
||||
html_show_sourcelink = False
|
||||
|
||||
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
|
||||
#html_show_sphinx = True
|
||||
@ -182,11 +199,24 @@ html_theme = 'default'
|
||||
# This is the file name suffix for HTML files (e.g. ".xhtml").
|
||||
#html_file_suffix = None
|
||||
|
||||
# Language to be used for generating the HTML full-text search index.
|
||||
# Sphinx supports the following languages:
|
||||
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja'
|
||||
# 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr'
|
||||
#html_search_language = 'en'
|
||||
|
||||
# A dictionary with options for the search language support, empty by default.
|
||||
# Now only 'ja' uses this config value
|
||||
#html_search_options = {'type': 'default'}
|
||||
|
||||
# The name of a javascript file (relative to the configuration directory) that
|
||||
# implements a search results scorer. If empty, the default will be used.
|
||||
#html_search_scorer = 'scorer.js'
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'Glancesdoc'
|
||||
|
||||
|
||||
# -- Options for LaTeX output --------------------------------------------------
|
||||
# -- Options for LaTeX output ---------------------------------------------
|
||||
|
||||
latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
@ -197,13 +227,17 @@ latex_elements = {
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#'preamble': '',
|
||||
|
||||
# Latex figure (float) alignment
|
||||
#'figure_align': 'htbp',
|
||||
}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title, author, documentclass [howto/manual]).
|
||||
# (source start file, target name, title,
|
||||
# author, documentclass [howto, manual, or own class]).
|
||||
latex_documents = [
|
||||
('index', 'Glances.tex', u'Glances Documentation',
|
||||
u'Nicolas Hennion', 'manual'),
|
||||
(master_doc, 'Glances.tex', 'Glances Documentation',
|
||||
'Nicolas Hennion', 'manual'),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
@ -227,28 +261,28 @@ latex_documents = [
|
||||
#latex_domain_indices = True
|
||||
|
||||
|
||||
# -- Options for manual page output --------------------------------------------
|
||||
# -- Options for manual page output ---------------------------------------
|
||||
|
||||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
('index', 'glances', u'Glances Documentation',
|
||||
[u'Nicolas Hennion'], 1)
|
||||
(master_doc, 'glances', 'Glances Documentation',
|
||||
[author], 1)
|
||||
]
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#man_show_urls = False
|
||||
|
||||
|
||||
# -- Options for Texinfo output ------------------------------------------------
|
||||
# -- Options for Texinfo output -------------------------------------------
|
||||
|
||||
# Grouping the document tree into Texinfo files. List of tuples
|
||||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
('index', 'Glances', u'Glances Documentation',
|
||||
u'Nicolas Hennion', 'Glances', 'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
(master_doc, 'Glances', 'Glances Documentation',
|
||||
author, 'Glances', 'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
]
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
@ -259,3 +293,6 @@ texinfo_documents = [
|
||||
|
||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
||||
#texinfo_show_urls = 'footnote'
|
||||
|
||||
# If true, do not generate a @detailmenu in the "Top" node's menu.
|
||||
#texinfo_no_detailmenu = False
|
||||
|
77
docs/config.rst
Normal file
@ -0,0 +1,77 @@
|
||||
.. _config:
|
||||
|
||||
Configuration
|
||||
=============
|
||||
|
||||
No configuration file is mandatory to use Glances.
|
||||
|
||||
Furthermore a configuration file is needed to access more settings.
|
||||
|
||||
Location
|
||||
--------
|
||||
|
||||
You can put the ``glances.conf`` file in the following locations:
|
||||
|
||||
=========== ============================================================
|
||||
``Linux`` ~/.config/glances, /etc/glances
|
||||
``*BSD`` ~/.config/glances, /usr/local/etc/glances
|
||||
``OS X`` ~/Library/Application Support/glances, /usr/local/etc/glances
|
||||
``Windows`` %APPDATA%\glances
|
||||
=========== ============================================================
|
||||
|
||||
On Windows XP, the ``%APPDATA%`` path is:
|
||||
|
||||
::
|
||||
|
||||
C:\Documents and Settings\<User>\Application Data
|
||||
|
||||
Since Windows Vista and newer versions:
|
||||
|
||||
::
|
||||
|
||||
C:\Users\<User>\AppData\Roaming
|
||||
|
||||
User-specific options override system-wide options and options given on
|
||||
the command line override either.
|
||||
|
||||
Syntax
|
||||
------
|
||||
|
||||
Glances reads configuration files in the *ini* syntax.
|
||||
|
||||
Each plugin and export module can have a section. Below an example for
|
||||
the CPU plugin:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[cpu]
|
||||
user_careful=50
|
||||
user_warning=70
|
||||
user_critical=90
|
||||
iowait_careful=50
|
||||
iowait_warning=70
|
||||
iowait_critical=90
|
||||
system_careful=50
|
||||
system_warning=70
|
||||
system_critical=90
|
||||
steal_careful=50
|
||||
steal_warning=70
|
||||
steal_critical=90
|
||||
|
||||
Logging
|
||||
-------
|
||||
|
||||
Glances logs all of its internal messages to a log file.
|
||||
|
||||
``DEBUG`` messages can been logged using the ``-d`` option on the command
|
||||
line.
|
||||
|
||||
By default, the ``glances.log`` file is under the temporary directory:
|
||||
|
||||
===================== ==================================================
|
||||
``Linux, *BSD, OS X`` /tmp
|
||||
``Windows`` %APPDATA%\\Local\\temp
|
||||
===================== ==================================================
|
||||
|
||||
If ``glances.log`` is not writable, a new file will be created and
|
||||
returned to the user console.
|
1058
docs/glances-doc.rst
15
docs/gw/csv.rst
Normal file
@ -0,0 +1,15 @@
|
||||
.. _csv:
|
||||
|
||||
CSV
|
||||
===
|
||||
|
||||
It's possible to export stats to a CSV file.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ glances --export-csv /tmp/glances.csv
|
||||
|
||||
CSV file description:
|
||||
|
||||
- Stats description (first line)
|
||||
- Stats (other lines)
|
38
docs/gw/elastic.rst
Normal file
@ -0,0 +1,38 @@
|
||||
.. _elastic:
|
||||
|
||||
Elasticsearch
|
||||
=============
|
||||
|
||||
You can export statistics to an ``elasticsearch`` server. The connection
|
||||
should be defined in the Glances configuration file as following:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[elasticsearch]
|
||||
host=localhost
|
||||
port=9200
|
||||
index=glances
|
||||
|
||||
and run Glances with:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ glances --export-elasticsearch
|
||||
|
||||
The stats are available through the elasticsearch API. For example, to
|
||||
get the CPU system stats:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ curl http://172.17.0.2:9200/glances/cpu/system
|
||||
{
|
||||
"_index": "glances",
|
||||
"_type": "cpu",
|
||||
"_id": "system",
|
||||
"_version": 28,
|
||||
"found": true,"
|
||||
_source": {
|
||||
"timestamp": "2016-02-04T14:11:02.362232",
|
||||
"value": "2.2"
|
||||
}
|
||||
}
|
17
docs/gw/index.rst
Normal file
@ -0,0 +1,17 @@
|
||||
.. _gw:
|
||||
|
||||
Gateway To Other Services
|
||||
=========================
|
||||
|
||||
Glances can exports stats to a CSV file. Also, it can act as a gateway
|
||||
to providing stats to multiple services.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
csv
|
||||
influxdb
|
||||
opentsdb
|
||||
statsd
|
||||
rabbitmq
|
||||
elastic
|
46
docs/gw/influxdb.rst
Normal file
@ -0,0 +1,46 @@
|
||||
.. _influxdb:
|
||||
|
||||
InfluxDB
|
||||
========
|
||||
|
||||
You can export statistics to an ``InfluxDB`` server (time series server).
|
||||
The connection should be defined in the Glances configuration file as
|
||||
following:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[influxdb]
|
||||
host=localhost
|
||||
port=8086
|
||||
user=root
|
||||
password=root
|
||||
db=glances
|
||||
|
||||
and run Glances with:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ glances --export-influxdb
|
||||
|
||||
InfluxDB 0.9 or higher also supports an optional ``tags`` configuration
|
||||
parameter specified as comma separated ``key:value`` pairs. For example:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[influxdb]
|
||||
host=localhost
|
||||
port=8086
|
||||
user=root
|
||||
password=root
|
||||
db=glances
|
||||
tags=foo:bar,spam:eggs
|
||||
|
||||
Grafana
|
||||
-------
|
||||
|
||||
For Grafana users, Glances provides a dedicated `dashboard`_. To use it,
|
||||
just import the file in your ``Grafana`` web interface.
|
||||
|
||||
.. image:: ../_static/grafana.png
|
||||
|
||||
.. _dashboard: https://github.com/nicolargo/glances/blob/master/conf/glances-grafana.json
|
22
docs/gw/opentsdb.rst
Normal file
@ -0,0 +1,22 @@
|
||||
.. _opentsdb:
|
||||
|
||||
OpenTSDB
|
||||
========
|
||||
|
||||
You can export statistics to an ``OpenTSDB`` server (time series server).
|
||||
The connection should be defined in the Glances configuration file as
|
||||
following:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[opentsdb]
|
||||
host=localhost
|
||||
port=4242
|
||||
prefix=glances
|
||||
tags=foo:bar,spam:eggs
|
||||
|
||||
and run Glances with:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ glances --export-opentsdb
|
23
docs/gw/rabbitmq.rst
Normal file
@ -0,0 +1,23 @@
|
||||
.. _rabbitmq:
|
||||
|
||||
RabbitMQ
|
||||
========
|
||||
|
||||
You can export statistics to an ``RabbitMQ`` server (AMQP Broker). The
|
||||
connection should be defined in the Glances configuration file as
|
||||
following:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[rabbitmq]
|
||||
host=localhost
|
||||
port=5672
|
||||
user=glances
|
||||
password=glances
|
||||
queue=glances_queue
|
||||
|
||||
and run Glances with:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ glances --export-rabbitmq
|
33
docs/gw/statsd.rst
Normal file
@ -0,0 +1,33 @@
|
||||
.. _statsd:
|
||||
|
||||
StatsD
|
||||
======
|
||||
|
||||
You can export statistics to a ``StatsD`` server (welcome to Graphite!).
|
||||
The connection should be defined in the Glances configuration file as
|
||||
following:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[statsd]
|
||||
host=localhost
|
||||
port=8125
|
||||
prefix=glances
|
||||
|
||||
.. note:: The ``prefix`` is optional (``glances`` by default)
|
||||
|
||||
and run Glances with:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ glances --export-statsd
|
||||
|
||||
Glances will generate stats as:
|
||||
|
||||
::
|
||||
|
||||
'glances.cpu.user': 12.5,
|
||||
'glances.cpu.total': 14.9,
|
||||
'glances.load.cpucore': 4,
|
||||
'glances.load.min1': 0.19,
|
||||
...
|
Before Width: | Height: | Size: 198 KiB |
Before Width: | Height: | Size: 286 KiB |
Before Width: | Height: | Size: 161 KiB |
Before Width: | Height: | Size: 622 KiB |
@ -1,28 +1,30 @@
|
||||
Welcome to Glances documentation!
|
||||
=================================
|
||||
Glances
|
||||
=======
|
||||
|
||||
**Glances** is a cross-platform curses-based monitoring tool written in Python.
|
||||
.. image:: _static/screenshot-wide.png
|
||||
|
||||
It uses the psutil library and some internal code to get information from your system.
|
||||
Glances is a cross-platform curses-based monitoring tool which aims to
|
||||
present a maximum of information in a minimum of space, ideally to fit
|
||||
in a classical 80x24 terminal or higher to have additional information.
|
||||
It can adapt dynamically the displayed information depending on the
|
||||
terminal size. It can also work in client/server mode. Remote monitoring
|
||||
could be done via terminal or web interface.
|
||||
|
||||
.. image:: images/screenshot-wide.png
|
||||
Glances is written in Python and uses the `psutil`_ library to get
|
||||
information from your system.
|
||||
|
||||
Get the code
|
||||
------------
|
||||
.. _psutil: https://github.com/giampaolo/psutil
|
||||
|
||||
The `source <http://github.com/nicolargo/glances>`_ is available on GitHub.
|
||||
|
||||
Contents
|
||||
--------
|
||||
Table of Contents
|
||||
=================
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
glances-doc
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
||||
quickstart
|
||||
cmds
|
||||
config
|
||||
aoa/index
|
||||
gw/index
|
||||
api
|
||||
support
|
||||
|
131
docs/init_script
@ -1,131 +0,0 @@
|
||||
#! /bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: glances
|
||||
# Required-Start: $remote_fs $local_fs $network
|
||||
# Required-Stop: $remote_fs $local_fs $network
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Starts and daemonize Glances server
|
||||
# Description: Starts and daemonize Glances server
|
||||
### END INIT INFO
|
||||
|
||||
|
||||
# PATH should only include /usr/* if it runs after the mountnfs.sh script
|
||||
PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
||||
DESC="Glances server"
|
||||
NAME=glances
|
||||
USER=$NAME
|
||||
DAEMON="/usr/bin/$NAME"
|
||||
PIDFILE="/run/$NAME/$NAME.pid"
|
||||
CONF="/etc/glances/glances.conf"
|
||||
DAEMON_ARGS="-C $CONF -s"
|
||||
|
||||
# Exit if the package is not installed
|
||||
[ -x "$DAEMON" ] || exit 0
|
||||
|
||||
# Read configuration variable file if it is present
|
||||
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
|
||||
|
||||
# Load the VERBOSE setting and other rcS variables
|
||||
. /lib/init/vars.sh
|
||||
|
||||
# Define LSB log_* functions.
|
||||
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
|
||||
# and status_of_proc is working.
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
# Ensure /run/glances is there, cf. Debian policy 9.4.1
|
||||
# http://www.debian.org/doc/debian-policy/ch-opersys.html#s-fhs-run
|
||||
if [ ! -d "$(dirname $PIDFILE)" ]; then
|
||||
mkdir "$(dirname $PIDFILE)"
|
||||
chown $USER:$USER "$(dirname $PIDFILE)"
|
||||
chmod 755 "$(dirname $PIDFILE)"
|
||||
fi
|
||||
|
||||
#
|
||||
# Function that starts the daemon/service
|
||||
#
|
||||
do_start()
|
||||
{
|
||||
log_daemon_msg "Starting $DESC" "$NAME "
|
||||
# Return
|
||||
# 0 if daemon has been started
|
||||
# 1 if daemon was already running
|
||||
# 2 if daemon could not be started
|
||||
[ -e $PIDFILE ] && PID=$(cat "$PIDFILE")
|
||||
if ( [ -e $PIDFILE ] && ps -p $PID 1>&2 > /dev/null )
|
||||
then
|
||||
log_action_end_msg 1 "already running, PID's $PID"
|
||||
exit 0
|
||||
elif ( [ -w $PIDFILE ] )
|
||||
then
|
||||
log_warning_msg "PID file found while ${NAME} is not running, removing file."
|
||||
rm $PIDFILE
|
||||
fi
|
||||
|
||||
if [ "$RUN" != "true" ]; then
|
||||
log_action_msg "Not starting glances: disabled by /etc/default/$NAME".
|
||||
exit 0
|
||||
fi
|
||||
|
||||
start-stop-daemon --start --chuid $USER --pidfile=$PIDFILE --quiet -m -b --exec $DAEMON -- $DAEMON_ARGS || return 2
|
||||
[ -e "$PIDFILE" ] && chown $USER $PIDFILE
|
||||
return 0
|
||||
}
|
||||
|
||||
#
|
||||
# Function that stops the daemon/service
|
||||
#
|
||||
do_stop()
|
||||
{
|
||||
log_daemon_msg "Stopping $DESC" "$NAME "
|
||||
if [ ! -w $PIDFILE ]
|
||||
then
|
||||
log_warning_msg "PID file not found"
|
||||
return 4
|
||||
fi
|
||||
start-stop-daemon --stop --oknodo --chuid $USER --pidfile=$PID --user=$USER --pidfile="$PIDFILE" --retry=30 || return 1
|
||||
/bin/rm -f $PIDFILE
|
||||
return 0
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
do_start
|
||||
case "$?" in
|
||||
0|1) log_end_msg 0 ;;
|
||||
2) log_end_msg 1 ;;
|
||||
esac
|
||||
;;
|
||||
stop)
|
||||
do_stop
|
||||
case "$?" in
|
||||
0) log_end_msg 0 ;;
|
||||
1) log_end_msg 1 ;;
|
||||
esac
|
||||
;;
|
||||
status)
|
||||
status_of_proc -p "$PIDFILE" "$DAEMON" "$NAME"
|
||||
;;
|
||||
restart|force-reload)
|
||||
do_stop
|
||||
case "$?" in
|
||||
0)
|
||||
log_end_msg 0
|
||||
do_start
|
||||
case "$?" in
|
||||
0) log_end_msg 0 ;;
|
||||
*) log_end_msg 1 ;; # Failed to start
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
# Failed to stop
|
||||
log_end_msg 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
echo "Usage: invoke-rc.d $NAME {start|stop|status|restart|force-reload}" >&2
|
||||
exit 3
|
||||
;;
|
||||
esac
|
263
docs/make.bat
Normal file
@ -0,0 +1,263 @@
|
||||
@ECHO OFF
|
||||
|
||||
REM Command file for Sphinx documentation
|
||||
|
||||
if "%SPHINXBUILD%" == "" (
|
||||
set SPHINXBUILD=sphinx-build
|
||||
)
|
||||
set BUILDDIR=_build
|
||||
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
|
||||
set I18NSPHINXOPTS=%SPHINXOPTS% .
|
||||
if NOT "%PAPER%" == "" (
|
||||
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
|
||||
set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
|
||||
)
|
||||
|
||||
if "%1" == "" goto help
|
||||
|
||||
if "%1" == "help" (
|
||||
:help
|
||||
echo.Please use `make ^<target^>` where ^<target^> is one of
|
||||
echo. html to make standalone HTML files
|
||||
echo. dirhtml to make HTML files named index.html in directories
|
||||
echo. singlehtml to make a single large HTML file
|
||||
echo. pickle to make pickle files
|
||||
echo. json to make JSON files
|
||||
echo. htmlhelp to make HTML files and a HTML help project
|
||||
echo. qthelp to make HTML files and a qthelp project
|
||||
echo. devhelp to make HTML files and a Devhelp project
|
||||
echo. epub to make an epub
|
||||
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
|
||||
echo. text to make text files
|
||||
echo. man to make manual pages
|
||||
echo. texinfo to make Texinfo files
|
||||
echo. gettext to make PO message catalogs
|
||||
echo. changes to make an overview over all changed/added/deprecated items
|
||||
echo. xml to make Docutils-native XML files
|
||||
echo. pseudoxml to make pseudoxml-XML files for display purposes
|
||||
echo. linkcheck to check all external links for integrity
|
||||
echo. doctest to run all doctests embedded in the documentation if enabled
|
||||
echo. coverage to run coverage check of the documentation if enabled
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "clean" (
|
||||
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
|
||||
del /q /s %BUILDDIR%\*
|
||||
goto end
|
||||
)
|
||||
|
||||
|
||||
REM Check if sphinx-build is available and fallback to Python version if any
|
||||
%SPHINXBUILD% 1>NUL 2>NUL
|
||||
if errorlevel 9009 goto sphinx_python
|
||||
goto sphinx_ok
|
||||
|
||||
:sphinx_python
|
||||
|
||||
set SPHINXBUILD=python -m sphinx.__init__
|
||||
%SPHINXBUILD% 2> nul
|
||||
if errorlevel 9009 (
|
||||
echo.
|
||||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
|
||||
echo.installed, then set the SPHINXBUILD environment variable to point
|
||||
echo.to the full path of the 'sphinx-build' executable. Alternatively you
|
||||
echo.may add the Sphinx directory to PATH.
|
||||
echo.
|
||||
echo.If you don't have Sphinx installed, grab it from
|
||||
echo.http://sphinx-doc.org/
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
:sphinx_ok
|
||||
|
||||
|
||||
if "%1" == "html" (
|
||||
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "dirhtml" (
|
||||
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "singlehtml" (
|
||||
%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "pickle" (
|
||||
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can process the pickle files.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "json" (
|
||||
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can process the JSON files.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "htmlhelp" (
|
||||
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can run HTML Help Workshop with the ^
|
||||
.hhp project file in %BUILDDIR%/htmlhelp.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "qthelp" (
|
||||
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can run "qcollectiongenerator" with the ^
|
||||
.qhcp project file in %BUILDDIR%/qthelp, like this:
|
||||
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Glances.qhcp
|
||||
echo.To view the help file:
|
||||
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Glances.ghc
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "devhelp" (
|
||||
%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "epub" (
|
||||
%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The epub file is in %BUILDDIR%/epub.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "latex" (
|
||||
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "latexpdf" (
|
||||
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
|
||||
cd %BUILDDIR%/latex
|
||||
make all-pdf
|
||||
cd %~dp0
|
||||
echo.
|
||||
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "latexpdfja" (
|
||||
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
|
||||
cd %BUILDDIR%/latex
|
||||
make all-pdf-ja
|
||||
cd %~dp0
|
||||
echo.
|
||||
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "text" (
|
||||
%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The text files are in %BUILDDIR%/text.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "man" (
|
||||
%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The manual pages are in %BUILDDIR%/man.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "texinfo" (
|
||||
%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "gettext" (
|
||||
%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "changes" (
|
||||
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.The overview file is in %BUILDDIR%/changes.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "linkcheck" (
|
||||
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Link check complete; look for any errors in the above output ^
|
||||
or in %BUILDDIR%/linkcheck/output.txt.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "doctest" (
|
||||
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Testing of doctests in the sources finished, look at the ^
|
||||
results in %BUILDDIR%/doctest/output.txt.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "coverage" (
|
||||
%SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Testing of coverage in the sources finished, look at the ^
|
||||
results in %BUILDDIR%/coverage/python.txt.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "xml" (
|
||||
%SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The XML files are in %BUILDDIR%/xml.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "pseudoxml" (
|
||||
%SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
|
||||
goto end
|
||||
)
|
||||
|
||||
:end
|
120
docs/quickstart.rst
Normal file
@ -0,0 +1,120 @@
|
||||
.. _quickstart:
|
||||
|
||||
Quickstart
|
||||
==========
|
||||
|
||||
This page gives a good introduction in how to get started with Glances.
|
||||
Glances offers 3 modes:
|
||||
|
||||
- Standalone
|
||||
- Client/Server
|
||||
- Web server
|
||||
|
||||
Standalone Mode
|
||||
---------------
|
||||
|
||||
Simply run:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ glances
|
||||
|
||||
Client/Server Mode
|
||||
------------------
|
||||
|
||||
If you want to remotely monitor a machine, called ``server``, from
|
||||
another one, called ``client``, just run on the server:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
server$ glances -s
|
||||
|
||||
and on the client:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
client$ glances -c @server
|
||||
|
||||
where ``@server`` is the IP address or hostname of the server.
|
||||
|
||||
Glances can centralize available Glances servers using the ``--browser``
|
||||
option. The server list can be statically defined via the configuration
|
||||
file (section ``[serverlist]``).
|
||||
|
||||
In server mode, you can set the bind address with ``-B ADDRESS`` and
|
||||
the listening TCP port with ``-p PORT``.
|
||||
|
||||
In client mode, you can set the TCP port of the server with ``-p PORT``.
|
||||
|
||||
Default binding address is ``0.0.0.0`` (Glances will listen on all the
|
||||
available network interfaces) and TCP port is ``61209``.
|
||||
|
||||
In client/server mode, limits are set by the server side.
|
||||
|
||||
You can set a password to access to the server ``--password``. By
|
||||
default, the username is ``glances`` but you can change it with
|
||||
``--username``.
|
||||
|
||||
If you ask it, the SHA password will be stored in ``username.pwd`` file.
|
||||
|
||||
Glances is ``IPv6`` compatible. Just use the ``-B ::`` option to bind to
|
||||
all IPv6 addresses.
|
||||
|
||||
Autodiscover
|
||||
^^^^^^^^^^^^
|
||||
|
||||
Glances can also detect and display all Glances servers available on
|
||||
your network via the ``zeroconf`` protocol (not available on Windows):
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
client$ glances --browser
|
||||
|
||||
Use ``--disable-autodiscover`` to disable it.
|
||||
|
||||
SNMP
|
||||
^^^^
|
||||
|
||||
As an experimental feature, if Glances server is not detected by the
|
||||
client, the latter will try to grab stats using the ``SNMP`` protocol:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
client$ glances -c @snmpserver
|
||||
|
||||
.. note::
|
||||
Stats grabbed by SNMP request are limited and OS dependent.
|
||||
|
||||
Web Server Mode
|
||||
---------------
|
||||
|
||||
.. image:: _static/screenshot-web.png
|
||||
|
||||
If you want to remotely monitor a machine, called ``server``, from any
|
||||
device with a web browser, just run the server with the ``-w`` option:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
server$ glances -w
|
||||
|
||||
then on the client enter the following URL in your favorite web browser:
|
||||
|
||||
::
|
||||
|
||||
http://@server:61208
|
||||
|
||||
where ``@server`` is the IP address or hostname of the server.
|
||||
|
||||
To change the refresh rate of the page, just add the period in seconds
|
||||
at the end of the URL. For example, to refresh the page every ``10``
|
||||
seconds:
|
||||
|
||||
::
|
||||
|
||||
http://@server:61208/10
|
||||
|
||||
The Glances web interface follows responsive web design principles.
|
||||
|
||||
Here's a screenshot from Chrome on Android:
|
||||
|
||||
.. image:: _static/screenshot-web2.png
|
109
docs/style.css
@ -1,109 +0,0 @@
|
||||
/*
|
||||
:Author: Alessio Sergi
|
||||
:Contact: al3hex at gmail dot com
|
||||
|
||||
Stylesheet for use with Docutils.
|
||||
|
||||
This file is the CSS for the Glances documentation.
|
||||
*/
|
||||
|
||||
body {
|
||||
margin-top: 1em;
|
||||
margin-left: 1em;
|
||||
max-width: 80em;
|
||||
font-family: serif;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
h1.title {
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
h2, h3, p.topic-title {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.first {
|
||||
/* override p.topic-title margin styles */
|
||||
margin-top: 0 ! important;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #0055df;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #339999;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: #800080;
|
||||
}
|
||||
|
||||
a.toc-backref {
|
||||
text-decoration: none;
|
||||
color: black;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
padding-left: 1ex;
|
||||
border-left: 1px solid #008000;
|
||||
max-width: 30em;
|
||||
}
|
||||
|
||||
p.topic-title {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
pre {
|
||||
margin-left: 2em;
|
||||
margin-right: 2em;
|
||||
}
|
||||
|
||||
.console, .literal-block {
|
||||
background-color: #eeeeee;
|
||||
border: 1px solid #cccccc;
|
||||
max-width: 60em;
|
||||
line-height: 19px;
|
||||
overflow: auto;
|
||||
padding: 6px 10px;
|
||||
border-radius: 3px 3px 3px 3px;
|
||||
}
|
||||
|
||||
span.option, tt.docutils {
|
||||
white-space: nowrap;
|
||||
border: 1px dotted #008000;
|
||||
padding: 1px;
|
||||
background-color: #eeeeee;
|
||||
}
|
||||
|
||||
.literal, .literal-block, .option, .var {
|
||||
font-family: monospace;
|
||||
font-size: 10pt;
|
||||
}
|
||||
|
||||
dl.docutils {
|
||||
margin-left: 2em;
|
||||
}
|
||||
|
||||
dl.docutils dd {
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
|
||||
ol.simple {
|
||||
margin-left: 0.5em;
|
||||
}
|
||||
|
||||
table.docutils {
|
||||
margin-left: 2em;
|
||||
}
|
||||
|
||||
td.option-group {
|
||||
padding-right: 1em;
|
||||
}
|
13
docs/support.rst
Normal file
@ -0,0 +1,13 @@
|
||||
.. _support:
|
||||
|
||||
Support
|
||||
=======
|
||||
|
||||
To post a question about Glances use cases, please post it to the
|
||||
official Q&A `forum
|
||||
<https://groups.google.com/forum/?hl=en#!forum/glances-users>`_.
|
||||
|
||||
To report a bug or a feature request use the GitHub `issue
|
||||
<https://github.com/nicolargo/glances/issues>`_ tracker.
|
||||
|
||||
Feel free to contribute!
|
3
setup.py
@ -30,8 +30,7 @@ class tests(Command):
|
||||
def get_data_files():
|
||||
data_files = [
|
||||
('share/doc/glances', ['AUTHORS', 'COPYING', 'NEWS', 'README.rst',
|
||||
'conf/glances.conf', 'docs/glances-doc.html']),
|
||||
('share/doc/glances/images', glob.glob('docs/images/*.png')),
|
||||
'conf/glances.conf']),
|
||||
('share/man/man1', ['man/glances.1'])
|
||||
]
|
||||
|
||||
|