From ae62450b89118a37eca2c624d5abdff429d4ff2f Mon Sep 17 00:00:00 2001 From: Jens Ritter Date: Mon, 20 Mar 2023 18:15:49 +0100 Subject: [PATCH] fix debian: total_cache is no longer available --- check_docker/check_docker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_docker/check_docker.py b/check_docker/check_docker.py index 1a9d754..58f5c51 100755 --- a/check_docker/check_docker.py +++ b/check_docker/check_docker.py @@ -520,7 +520,7 @@ def check_memory(container, thresholds): inspection = get_stats(container) # Subtracting cache to match what `docker stats` does. - adjusted_usage = inspection['memory_stats']['usage'] - inspection['memory_stats']['stats']['total_cache'] + adjusted_usage = inspection['memory_stats']['usage'] - inspection['memory_stats']['stats']['inactive_file'] if thresholds.units == '%': max = 100 usage = int(100 * adjusted_usage / inspection['memory_stats']['limit'])