summaryrefslogtreecommitdiffstats
path: root/plugins/check_ntp_time.d/config.h
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2025-11-04 12:08:59 +0100
committerLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2025-11-04 12:08:59 +0100
commitb35853ee4e10c4485a9521d77c95aecae6573e64 (patch)
tree29402e5bbf420523682d3ef4357e609c93f8526f /plugins/check_ntp_time.d/config.h
parentbb9fcf5bfaf34aeffd651919b5a14b631b9fceb4 (diff)
downloadmonitoring-plugins-b35853ee4e10c4485a9521d77c95aecae6573e64.tar.gz
check_ntp_time: implement modern output
Diffstat (limited to 'plugins/check_ntp_time.d/config.h')
-rw-r--r--plugins/check_ntp_time.d/config.h13
1 files changed, 11 insertions, 2 deletions
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 {
11 bool quiet; 11 bool quiet;
12 int time_offset; 12 int time_offset;
13 13
14 thresholds *offset_thresholds; 14 mp_thresholds offset_thresholds;
15} check_ntp_time_config; 15} check_ntp_time_config;
16 16
17check_ntp_time_config check_ntp_time_config_init() { 17check_ntp_time_config check_ntp_time_config_init() {
@@ -22,7 +22,16 @@ check_ntp_time_config check_ntp_time_config_init() {
22 .quiet = false, 22 .quiet = false,
23 .time_offset = 0, 23 .time_offset = 0,
24 24
25 .offset_thresholds = NULL, 25 .offset_thresholds = mp_thresholds_init(),
26 }; 26 };
27
28 mp_range warning = mp_range_init();
29 warning = mp_range_set_end(warning, mp_create_pd_value(60));
30 tmp.offset_thresholds = mp_thresholds_set_warn(tmp.offset_thresholds, warning);
31
32 mp_range critical = mp_range_init();
33 critical = mp_range_set_end(warning, mp_create_pd_value(120));
34 tmp.offset_thresholds = mp_thresholds_set_crit(tmp.offset_thresholds, critical);
35
27 return tmp; 36 return tmp;
28} 37}