2016-03-02 15:29:19 +03:00
|
|
|
.. _docker:
|
|
|
|
|
|
|
|
Docker
|
|
|
|
======
|
|
|
|
|
|
|
|
If you use ``Docker``, Glances can help you to monitor your containers.
|
|
|
|
Glances uses the Docker API through the `docker-py`_ library.
|
|
|
|
|
2019-01-20 12:56:30 +03:00
|
|
|
You can install this dependency using:
|
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
pip install glances[docker]
|
|
|
|
|
2016-03-02 15:29:19 +03:00
|
|
|
.. image:: ../_static/docker.png
|
|
|
|
|
2016-10-10 22:10:10 +03:00
|
|
|
It is possible to define limits and actions from the configuration file
|
|
|
|
under the ``[docker]`` section:
|
|
|
|
|
|
|
|
.. code-block:: ini
|
|
|
|
|
|
|
|
[docker]
|
2020-09-12 12:01:48 +03:00
|
|
|
disable=False
|
2022-10-03 16:53:24 +03:00
|
|
|
# Only show specific containers (comma separated list of container name or regular expression)
|
2020-11-15 11:50:53 +03:00
|
|
|
show=thiscontainer,andthisone,andthoseones.*
|
2022-10-03 16:53:24 +03:00
|
|
|
# Hide some containers (comma separated list of container name or regular expression)
|
2020-11-15 11:50:53 +03:00
|
|
|
hide=donotshowthisone,andthose.*
|
2022-10-03 16:53:24 +03:00
|
|
|
# Show only specific containers (comma separated list of container name or regular expression)
|
2022-05-22 17:27:46 +03:00
|
|
|
#show=showthisone,andthose.*
|
2020-09-12 12:01:48 +03:00
|
|
|
# Define the maximum docker size name (default is 20 chars)
|
|
|
|
max_name_size=20
|
2016-10-10 22:10:10 +03:00
|
|
|
# Global containers' thresholds for CPU and MEM (in %)
|
|
|
|
cpu_careful=50
|
|
|
|
cpu_warning=70
|
|
|
|
cpu_critical=90
|
|
|
|
mem_careful=20
|
|
|
|
mem_warning=50
|
|
|
|
mem_critical=70
|
|
|
|
# Per container thresholds
|
|
|
|
containername_cpu_careful=10
|
|
|
|
containername_cpu_warning=20
|
|
|
|
containername_cpu_critical=30
|
|
|
|
containername_cpu_critical_action=echo {{Image}} {{Id}} {{cpu}} > /tmp/container_{{name}}.alert
|
2017-10-12 11:33:18 +03:00
|
|
|
# By default, Glances only display running containers
|
|
|
|
# Set the following key to True to display all containers
|
|
|
|
all=False
|
2016-10-10 22:10:10 +03:00
|
|
|
|
|
|
|
You can use all the variables ({{foo}}) available in the Docker plugin.
|
|
|
|
|
2023-01-22 13:14:59 +03:00
|
|
|
Filtering (for hide or show) is based on regular expression. Please be sure that your regular
|
|
|
|
expression works as expected. You can use an online tool like `regex101`_ in
|
|
|
|
order to test your regular expression.
|
|
|
|
|
|
|
|
.. _regex101: https://regex101.com/
|
2016-03-02 15:29:19 +03:00
|
|
|
.. _docker-py: https://github.com/docker/docker-py
|