diff options
| author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2025-11-05 13:54:43 +0100 |
|---|---|---|
| committer | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2025-11-05 13:54:43 +0100 |
| commit | 8e5cb31dc1fac2760233352e7d8e3b09812a80a1 (patch) | |
| tree | d4d84c58cd7746e1e0298d3eff0aebedefdab3dc /plugins/check_ntp_peer.d/config.h | |
| parent | ba6f90373333246bce196dbba494fa4af0bd9253 (diff) | |
| parent | ad7acf4618f1ac8a49277a482fb4ca391a26f584 (diff) | |
| download | monitoring-plugins-8e5cb31dc1fac2760233352e7d8e3b09812a80a1.tar.gz | |
Merge branch 'master' into modern_output/check_pgsql
Diffstat (limited to 'plugins/check_ntp_peer.d/config.h')
| -rw-r--r-- | plugins/check_ntp_peer.d/config.h | 63 |
1 files changed, 39 insertions, 24 deletions
diff --git a/plugins/check_ntp_peer.d/config.h b/plugins/check_ntp_peer.d/config.h index 00e6b05d..488d936c 100644 --- a/plugins/check_ntp_peer.d/config.h +++ b/plugins/check_ntp_peer.d/config.h | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | #pragma once | 1 | #pragma once |
| 2 | 2 | ||
| 3 | #include "../../config.h" | 3 | #include "../../config.h" |
| 4 | #include "output.h" | ||
| 5 | #include "perfdata.h" | ||
| 4 | #include "thresholds.h" | 6 | #include "thresholds.h" |
| 5 | #include <stddef.h> | 7 | #include <stddef.h> |
| 6 | 8 | ||
| @@ -16,26 +18,21 @@ typedef struct { | |||
| 16 | 18 | ||
| 17 | // truechimer stuff | 19 | // truechimer stuff |
| 18 | bool do_truechimers; | 20 | bool do_truechimers; |
| 19 | char *twarn; | 21 | mp_thresholds truechimer_thresholds; |
| 20 | char *tcrit; | ||
| 21 | thresholds *truechimer_thresholds; | ||
| 22 | 22 | ||
| 23 | char *owarn; | 23 | // offset thresholds |
| 24 | char *ocrit; | 24 | mp_thresholds offset_thresholds; |
| 25 | thresholds *offset_thresholds; | ||
| 26 | 25 | ||
| 27 | // stratum stuff | 26 | // stratum stuff |
| 28 | bool do_stratum; | 27 | bool do_stratum; |
| 29 | char *swarn; | 28 | mp_thresholds stratum_thresholds; |
| 30 | char *scrit; | ||
| 31 | thresholds *stratum_thresholds; | ||
| 32 | 29 | ||
| 33 | // jitter stuff | 30 | // jitter stuff |
| 34 | bool do_jitter; | 31 | bool do_jitter; |
| 35 | char *jwarn; | 32 | mp_thresholds jitter_thresholds; |
| 36 | char *jcrit; | ||
| 37 | thresholds *jitter_thresholds; | ||
| 38 | 33 | ||
| 34 | bool output_format_is_set; | ||
| 35 | mp_output_format output_format; | ||
| 39 | } check_ntp_peer_config; | 36 | } check_ntp_peer_config; |
| 40 | 37 | ||
| 41 | check_ntp_peer_config check_ntp_peer_config_init() { | 38 | check_ntp_peer_config check_ntp_peer_config_init() { |
| @@ -45,23 +42,41 @@ check_ntp_peer_config check_ntp_peer_config_init() { | |||
| 45 | 42 | ||
| 46 | .quiet = false, | 43 | .quiet = false, |
| 47 | .do_truechimers = false, | 44 | .do_truechimers = false, |
| 48 | .twarn = "0:", | 45 | .truechimer_thresholds = mp_thresholds_init(), |
| 49 | .tcrit = "0:", | ||
| 50 | .truechimer_thresholds = NULL, | ||
| 51 | 46 | ||
| 52 | .owarn = "60", | 47 | .offset_thresholds = mp_thresholds_init(), |
| 53 | .ocrit = "120", | ||
| 54 | .offset_thresholds = NULL, | ||
| 55 | 48 | ||
| 56 | .do_stratum = false, | 49 | .do_stratum = false, |
| 57 | .swarn = "-1:16", | 50 | .stratum_thresholds = mp_thresholds_init(), |
| 58 | .scrit = "-1:16", | ||
| 59 | .stratum_thresholds = NULL, | ||
| 60 | 51 | ||
| 61 | .do_jitter = false, | 52 | .do_jitter = false, |
| 62 | .jwarn = "-1:5000", | 53 | .jitter_thresholds = mp_thresholds_init(), |
| 63 | .jcrit = "-1:10000", | 54 | |
| 64 | .jitter_thresholds = NULL, | 55 | .output_format_is_set = false, |
| 65 | }; | 56 | }; |
| 57 | |||
| 58 | mp_range stratum_default = mp_range_init(); | ||
| 59 | stratum_default = mp_range_set_start(stratum_default, mp_create_pd_value(-1)); | ||
| 60 | stratum_default = mp_range_set_end(stratum_default, mp_create_pd_value(16)); | ||
| 61 | tmp.stratum_thresholds = mp_thresholds_set_warn(tmp.stratum_thresholds, stratum_default); | ||
| 62 | tmp.stratum_thresholds = mp_thresholds_set_crit(tmp.stratum_thresholds, stratum_default); | ||
| 63 | |||
| 64 | mp_range jitter_w_default = mp_range_init(); | ||
| 65 | jitter_w_default = mp_range_set_start(jitter_w_default, mp_create_pd_value(-1)); | ||
| 66 | jitter_w_default = mp_range_set_end(jitter_w_default, mp_create_pd_value(5000)); | ||
| 67 | tmp.jitter_thresholds = mp_thresholds_set_warn(tmp.jitter_thresholds, jitter_w_default); | ||
| 68 | |||
| 69 | mp_range jitter_c_default = mp_range_init(); | ||
| 70 | jitter_c_default = mp_range_set_start(jitter_c_default, mp_create_pd_value(-1)); | ||
| 71 | jitter_c_default = mp_range_set_end(jitter_c_default, mp_create_pd_value(10000)); | ||
| 72 | tmp.jitter_thresholds = mp_thresholds_set_crit(tmp.jitter_thresholds, jitter_c_default); | ||
| 73 | |||
| 74 | mp_range offset_w_default = mp_range_init(); | ||
| 75 | offset_w_default = mp_range_set_end(offset_w_default, mp_create_pd_value(60)); | ||
| 76 | tmp.offset_thresholds = mp_thresholds_set_warn(tmp.offset_thresholds, offset_w_default); | ||
| 77 | |||
| 78 | mp_range offset_c_default = mp_range_init(); | ||
| 79 | offset_c_default = mp_range_set_end(offset_c_default, mp_create_pd_value(120)); | ||
| 80 | tmp.offset_thresholds = mp_thresholds_set_crit(tmp.offset_thresholds, offset_c_default); | ||
| 66 | return tmp; | 81 | return tmp; |
| 67 | } | 82 | } |
