From 0645c9fc2c7f801ba3c7d68a17c137a63ada299f Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Tue, 18 Feb 2025 21:58:34 +0100 Subject: Implement new output functionality --- lib/thresholds.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 lib/thresholds.h (limited to 'lib/thresholds.h') diff --git a/lib/thresholds.h b/lib/thresholds.h new file mode 100644 index 00000000..4e7defee --- /dev/null +++ b/lib/thresholds.h @@ -0,0 +1,28 @@ +#pragma once + +#include "./perfdata.h" +#include "states.h" + +/* + * Old threshold type using the old range type + */ +typedef struct thresholds_struct { + range *warning; + range *critical; +} thresholds; + +typedef struct mp_thresholds_struct { + bool warning_is_set; + mp_range warning; + bool critical_is_set; + mp_range critical; +} mp_thresholds; + +mp_thresholds mp_thresholds_init(void); + +mp_perfdata mp_pd_set_thresholds(mp_perfdata /* pd */, mp_thresholds /* th */); + +mp_state_enum mp_get_pd_status(mp_perfdata /* pd */); + +char *fmt_threshold_warning(thresholds th); +char *fmt_threshold_critical(thresholds th); -- cgit v1.2.3-74-g34f1