summaryrefslogtreecommitdiffstats
path: root/plugins/check_ntp_time.d
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2025-11-05 10:55:10 +0100
committerGitHub <noreply@github.com>2025-11-05 10:55:10 +0100
commit37536c1af93b6bbe1553b7f022b4da2661166134 (patch)
tree8f465ef551d0dac2a07e5ff15b3f368a9f94a726 /plugins/check_ntp_time.d
parent8a4d8bc5d6605851a733ab7cad0e7e097fd3d5d8 (diff)
parent7b226257b7df01dd80af07c39e0f49fdcf84cee4 (diff)
downloadmonitoring-plugins-37536c1af93b6bbe1553b7f022b4da2661166134.tar.gz
Merge pull request #2171 from RincewindsHat/modern_output/check_ntp_time
check_ntp_time: implement modern output
Diffstat (limited to 'plugins/check_ntp_time.d')
-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}