From b35853ee4e10c4485a9521d77c95aecae6573e64 Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Tue, 4 Nov 2025 12:08:59 +0100 Subject: check_ntp_time: implement modern output --- plugins/check_ntp_time.d/config.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'plugins/check_ntp_time.d/config.h') diff --git a/plugins/check_ntp_time.d/config.h b/plugins/check_ntp_time.d/config.h index 99dabbbd..a62e4ceb 100644 --- a/plugins/check_ntp_time.d/config.h +++ b/plugins/check_ntp_time.d/config.h @@ -11,7 +11,7 @@ typedef struct { bool quiet; int time_offset; - thresholds *offset_thresholds; + mp_thresholds offset_thresholds; } check_ntp_time_config; check_ntp_time_config check_ntp_time_config_init() { @@ -22,7 +22,16 @@ check_ntp_time_config check_ntp_time_config_init() { .quiet = false, .time_offset = 0, - .offset_thresholds = NULL, + .offset_thresholds = mp_thresholds_init(), }; + + mp_range warning = mp_range_init(); + warning = mp_range_set_end(warning, mp_create_pd_value(60)); + tmp.offset_thresholds = mp_thresholds_set_warn(tmp.offset_thresholds, warning); + + mp_range critical = mp_range_init(); + critical = mp_range_set_end(warning, mp_create_pd_value(120)); + tmp.offset_thresholds = mp_thresholds_set_crit(tmp.offset_thresholds, critical); + return tmp; } -- cgit v1.2.3-74-g34f1