From bc0cf31a12f7ab2b8ab6db38fb16b6dfa308b02b Mon Sep 17 00:00:00 2001 From: nicolargo Date: Sun, 15 Nov 2020 09:36:32 +0100 Subject: [PATCH] Add hide filter to Docker list (first part of #1748) --- conf/glances.conf | 2 ++ glances/plugins/glances_docker.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/conf/glances.conf b/conf/glances.conf index 716642ca..6393a11f 100644 --- a/conf/glances.conf +++ b/conf/glances.conf @@ -327,6 +327,8 @@ port_default_gateway=True [docker] disable=False +# Hide some containers (comma separeted list) +#hide=telegraf # Define the maximum docker size name (default is 20 chars) max_name_size=20 #cpu_careful=50 diff --git a/glances/plugins/glances_docker.py b/glances/plugins/glances_docker.py index 3062404b..14f35af8 100644 --- a/glances/plugins/glances_docker.py +++ b/glances/plugins/glances_docker.py @@ -210,6 +210,10 @@ class Plugin(GlancesPlugin): # Get stats for all containers stats['containers'] = [] for container in containers: + # Do not take hide container into account + if self.is_hide(nativestr(container.name)): + continue + # Init the stats for the current container container_stats = {} # The key is the container name and not the Id