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-05 13:54:43 +0100
committerLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2025-11-05 13:54:43 +0100
commit8e5cb31dc1fac2760233352e7d8e3b09812a80a1 (patch)
treed4d84c58cd7746e1e0298d3eff0aebedefdab3dc /plugins/check_ntp_time.d/config.h
parentba6f90373333246bce196dbba494fa4af0bd9253 (diff)
parentad7acf4618f1ac8a49277a482fb4ca391a26f584 (diff)
downloadmonitoring-plugins-8e5cb31dc1fac2760233352e7d8e3b09812a80a1.tar.gz
Merge branch 'master' into modern_output/check_pgsql
Diffstat (limited to 'plugins/check_ntp_time.d/config.h')
-rw-r--r--plugins/check_ntp_time.d/config.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/plugins/check_ntp_time.d/config.h b/plugins/check_ntp_time.d/config.h
index 99dabbbd..9bbd82aa 100644
--- a/plugins/check_ntp_time.d/config.h
+++ b/plugins/check_ntp_time.d/config.h
@@ -1,6 +1,7 @@
1#pragma once 1#pragma once
2 2
3#include "../../config.h" 3#include "../../config.h"
4#include "output.h"
4#include "thresholds.h" 5#include "thresholds.h"
5#include <stddef.h> 6#include <stddef.h>
6 7
@@ -11,7 +12,10 @@ typedef struct {
11 bool quiet; 12 bool quiet;
12 int time_offset; 13 int time_offset;
13 14
14 thresholds *offset_thresholds; 15 mp_thresholds offset_thresholds;
16
17 bool output_format_is_set;
18 mp_output_format output_format;
15} check_ntp_time_config; 19} check_ntp_time_config;
16 20
17check_ntp_time_config check_ntp_time_config_init() { 21check_ntp_time_config check_ntp_time_config_init() {
@@ -22,7 +26,18 @@ check_ntp_time_config check_ntp_time_config_init() {
22 .quiet = false, 26 .quiet = false,
23 .time_offset = 0, 27 .time_offset = 0,
24 28
25 .offset_thresholds = NULL, 29 .offset_thresholds = mp_thresholds_init(),
30
31 .output_format_is_set = false,
26 }; 32 };
33
34 mp_range warning = mp_range_init();
35 warning = mp_range_set_end(warning, mp_create_pd_value(60));
36 tmp.offset_thresholds = mp_thresholds_set_warn(tmp.offset_thresholds, warning);
37
38 mp_range critical = mp_range_init();
39 critical = mp_range_set_end(warning, mp_create_pd_value(120));
40 tmp.offset_thresholds = mp_thresholds_set_crit(tmp.offset_thresholds, critical);
41
27 return tmp; 42 return tmp;
28} 43}