diff options
author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2025-03-10 21:49:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-10 21:49:21 +0100 |
commit | 14671421030843ed15816162245a0ef348db3315 (patch) | |
tree | 9d915eda8edc97ef674c3b9432791a333e2c1947 /plugins/check_dig.d | |
parent | 205384194dc5334aa3d8d8162f1e17e10595fdb3 (diff) | |
parent | 2a0943a7612f1c048668e2a43b0ee241297b3d0f (diff) | |
download | monitoring-plugins-14671421030843ed15816162245a0ef348db3315.tar.gz |
Merge pull request #2082 from RincewindsHat/refactor/check_dig
Refactor/check dig
Diffstat (limited to 'plugins/check_dig.d')
-rw-r--r-- | plugins/check_dig.d/config.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/plugins/check_dig.d/config.h b/plugins/check_dig.d/config.h new file mode 100644 index 00000000..a570b633 --- /dev/null +++ b/plugins/check_dig.d/config.h | |||
@@ -0,0 +1,40 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include "../../config.h" | ||
4 | #include <stddef.h> | ||
5 | |||
6 | #define UNDEFINED 0 | ||
7 | #define DEFAULT_PORT 53 | ||
8 | #define DEFAULT_TRIES 2 | ||
9 | |||
10 | typedef struct { | ||
11 | char *query_address; | ||
12 | char *record_type; | ||
13 | char *expected_address; | ||
14 | char *dns_server; | ||
15 | char *query_transport; | ||
16 | int server_port; | ||
17 | char *dig_args; | ||
18 | int number_tries; | ||
19 | |||
20 | double warning_interval; | ||
21 | double critical_interval; | ||
22 | } check_dig_config; | ||
23 | |||
24 | check_dig_config check_dig_config_init() { | ||
25 | check_dig_config tmp = { | ||
26 | .query_address = NULL, | ||
27 | .record_type = "A", | ||
28 | .expected_address = NULL, | ||
29 | .dns_server = NULL, | ||
30 | .query_transport = "", | ||
31 | .server_port = DEFAULT_PORT, | ||
32 | .dig_args = "", | ||
33 | .number_tries = DEFAULT_TRIES, | ||
34 | |||
35 | .warning_interval = UNDEFINED, | ||
36 | .critical_interval = UNDEFINED, | ||
37 | |||
38 | }; | ||
39 | return tmp; | ||
40 | } | ||