diff options
Diffstat (limited to 'plugins/check_ntp_time.d')
| -rw-r--r-- | plugins/check_ntp_time.d/config.h | 19 |
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 | ||
| 17 | check_ntp_time_config check_ntp_time_config_init() { | 21 | check_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 | } |
