From 651925dffce258bf71a6717fd3d4e0969f29b6a6 Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Sun, 10 Nov 2024 01:58:41 +0100 Subject: check_swap: Make check_swap work without thresholds --- plugins/check_swap.d/check_swap.h | 7 ++++--- plugins/check_swap.d/swap.c | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'plugins/check_swap.d') diff --git a/plugins/check_swap.d/check_swap.h b/plugins/check_swap.d/check_swap.h index 9e8be75f..e3e350c5 100644 --- a/plugins/check_swap.d/check_swap.h +++ b/plugins/check_swap.d/check_swap.h @@ -8,9 +8,10 @@ #endif typedef struct { + bool is_set; bool is_percentage; uint64_t value; -} threshold; +} check_swap_threshold; typedef struct { unsigned long long free; // Free swap in Bytes! @@ -27,8 +28,8 @@ typedef struct { typedef struct { bool allswaps; int no_swap_state; - threshold warn; - threshold crit; + check_swap_threshold warn; + check_swap_threshold crit; bool on_aix; int conversion_factor; } swap_config; diff --git a/plugins/check_swap.d/swap.c b/plugins/check_swap.d/swap.c index 18db210c..293fdd71 100644 --- a/plugins/check_swap.d/swap.c +++ b/plugins/check_swap.d/swap.c @@ -10,6 +10,9 @@ swap_config swap_config_init(void) { tmp.no_swap_state = STATE_CRITICAL; tmp.conversion_factor = SWAP_CONVERSION; + tmp.warn.is_set = false; + tmp.crit.is_set = false; + #ifdef _AIX tmp.on_aix = true; #else -- cgit v1.2.3-74-g34f1