From 98e47b9a386858913625520747b11f1ecc31c693 Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Wed, 21 Jun 2023 13:22:41 +0200 Subject: [PATCH] fix: raise warning if swap is missing when logging swap usage --- src/de/p1st/monitor/loggers/swap.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/de/p1st/monitor/loggers/swap.py b/src/de/p1st/monitor/loggers/swap.py index 133d89d..610c241 100644 --- a/src/de/p1st/monitor/loggers/swap.py +++ b/src/de/p1st/monitor/loggers/swap.py @@ -29,8 +29,7 @@ class SwapLogger(Logger): message = f'Swap usage ist at {used_mb} MB of {total_mb} MB' if used_mb == 0 and total_mb == 0: - # Swap not enabled. - return WarnMessage(WarnLevel.NONE) + return WarnMessage(WarnLevel.HIGH, 'Swap is not enabled') usage = used_mb / total_mb