diff options
Diffstat (limited to 'plugins/check_dig.d/config.h')
| -rw-r--r-- | plugins/check_dig.d/config.h | 48 |
1 files changed, 48 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..dd1f58b5 --- /dev/null +++ b/plugins/check_dig.d/config.h | |||
| @@ -0,0 +1,48 @@ | |||
| 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 **items; | ||
| 12 | size_t count; | ||
| 13 | } flag_list; | ||
| 14 | |||
| 15 | typedef struct { | ||
| 16 | char *query_address; | ||
| 17 | char *record_type; | ||
| 18 | char *expected_address; | ||
| 19 | char *dns_server; | ||
| 20 | char *query_transport; | ||
| 21 | int server_port; | ||
| 22 | char *dig_args; | ||
| 23 | int number_tries; | ||
| 24 | |||
| 25 | double warning_interval; | ||
| 26 | double critical_interval; | ||
| 27 | flag_list require_flags; | ||
| 28 | flag_list forbid_flags; | ||
| 29 | } check_dig_config; | ||
| 30 | |||
| 31 | check_dig_config check_dig_config_init() { | ||
| 32 | check_dig_config tmp = { | ||
| 33 | .query_address = NULL, | ||
| 34 | .record_type = "A", | ||
| 35 | .expected_address = NULL, | ||
| 36 | .dns_server = NULL, | ||
| 37 | .query_transport = "", | ||
| 38 | .server_port = DEFAULT_PORT, | ||
| 39 | .dig_args = "", | ||
| 40 | .number_tries = DEFAULT_TRIES, | ||
| 41 | |||
| 42 | .warning_interval = UNDEFINED, | ||
| 43 | .critical_interval = UNDEFINED, | ||
| 44 | .require_flags = {.count = 0, .items = NULL}, | ||
| 45 | .forbid_flags = {.count = 0, .items = NULL}, | ||
| 46 | }; | ||
| 47 | return tmp; | ||
| 48 | } | ||
