diff options
| author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2025-03-12 01:00:48 +0100 |
|---|---|---|
| committer | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2025-03-12 01:00:48 +0100 |
| commit | 8b2222e8b704fc451093996e906c07a6a8e3538a (patch) | |
| tree | 317862c640dada64ccb7faf2c4c74bb39f2f80e2 /plugins/check_ntp_peer.d/config.h | |
| parent | 9f6f32324e694d51e9e01e07fcd9694736f7846a (diff) | |
| download | monitoring-plugins-8b2222e8.tar.gz | |
Refactor check_ntp_peer
Diffstat (limited to 'plugins/check_ntp_peer.d/config.h')
| -rw-r--r-- | plugins/check_ntp_peer.d/config.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/plugins/check_ntp_peer.d/config.h b/plugins/check_ntp_peer.d/config.h new file mode 100644 index 00000000..1907af7c --- /dev/null +++ b/plugins/check_ntp_peer.d/config.h | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include "../../config.h" | ||
| 4 | #include <stddef.h> | ||
| 5 | |||
| 6 | enum { | ||
| 7 | DEFAULT_NTP_PORT = 123, | ||
| 8 | }; | ||
| 9 | |||
| 10 | typedef struct { | ||
| 11 | char *server_address; | ||
| 12 | int port; | ||
| 13 | |||
| 14 | bool quiet; | ||
| 15 | |||
| 16 | // truechimer stuff | ||
| 17 | bool do_truechimers; | ||
| 18 | char *twarn; | ||
| 19 | char *tcrit; | ||
| 20 | |||
| 21 | char *owarn; | ||
| 22 | char *ocrit; | ||
| 23 | |||
| 24 | // stratum stuff | ||
| 25 | bool do_stratum; | ||
| 26 | char *swarn; | ||
| 27 | char *scrit; | ||
| 28 | |||
| 29 | // jitter stuff | ||
| 30 | bool do_jitter; | ||
| 31 | char *jwarn; | ||
| 32 | char *jcrit; | ||
| 33 | } check_ntp_peer_config; | ||
| 34 | |||
| 35 | check_ntp_peer_config check_ntp_peer_config_init() { | ||
| 36 | check_ntp_peer_config tmp = { | ||
| 37 | .server_address = NULL, | ||
| 38 | .port = DEFAULT_NTP_PORT, | ||
| 39 | |||
| 40 | .quiet = false, | ||
| 41 | .do_truechimers = false, | ||
| 42 | .twarn = "0:", | ||
| 43 | .tcrit = "0:", | ||
| 44 | .owarn = "60", | ||
| 45 | .ocrit = "120", | ||
| 46 | .do_stratum = false, | ||
| 47 | .swarn = "-1:16", | ||
| 48 | .scrit = "-1:16", | ||
| 49 | .do_jitter = false, | ||
| 50 | .jwarn = "-1:5000", | ||
| 51 | .jcrit = "-1:10000", | ||
| 52 | }; | ||
| 53 | return tmp; | ||
| 54 | } | ||
