summaryrefslogtreecommitdiffstats
path: root/plugins/check_dig.d/config.h
diff options
context:
space:
mode:
authorDennis <13968467+Decstasy@users.noreply.github.com>2025-11-29 15:24:52 +0100
committerGitHub <noreply@github.com>2025-11-29 15:24:52 +0100
commitfd42290d4a0aafd0d3c154cdd8fad53bfcc79046 (patch)
tree59f2080e483262813148e61883b7c35ee094f5d0 /plugins/check_dig.d/config.h
parentdb2983da7e8175ca3928998d4547acdf75d55dc0 (diff)
downloadmonitoring-plugins-fd42290d4a0aafd0d3c154cdd8fad53bfcc79046.tar.gz
check_dig: add -E/--require-flags and -X/--forbid-flags (#2165)HEADmaster
* check_dig: Add feature to require or forbid dig DNS flags -E, -X. Introduced helper functions for flag parsing. -E, --require-flags=LIST Comma-separated dig flags that must be present (e.g. 'aa,qr') -X, --forbid-flags=LIST Comma-separated dig flags that must NOT be present
Diffstat (limited to 'plugins/check_dig.d/config.h')
-rw-r--r--plugins/check_dig.d/config.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/check_dig.d/config.h b/plugins/check_dig.d/config.h
index a570b633..dd1f58b5 100644
--- a/plugins/check_dig.d/config.h
+++ b/plugins/check_dig.d/config.h
@@ -8,6 +8,11 @@
8#define DEFAULT_TRIES 2 8#define DEFAULT_TRIES 2
9 9
10typedef struct { 10typedef struct {
11 char **items;
12 size_t count;
13} flag_list;
14
15typedef struct {
11 char *query_address; 16 char *query_address;
12 char *record_type; 17 char *record_type;
13 char *expected_address; 18 char *expected_address;
@@ -19,6 +24,8 @@ typedef struct {
19 24
20 double warning_interval; 25 double warning_interval;
21 double critical_interval; 26 double critical_interval;
27 flag_list require_flags;
28 flag_list forbid_flags;
22} check_dig_config; 29} check_dig_config;
23 30
24check_dig_config check_dig_config_init() { 31check_dig_config check_dig_config_init() {
@@ -34,7 +41,8 @@ check_dig_config check_dig_config_init() {
34 41
35 .warning_interval = UNDEFINED, 42 .warning_interval = UNDEFINED,
36 .critical_interval = UNDEFINED, 43 .critical_interval = UNDEFINED,
37 44 .require_flags = {.count = 0, .items = NULL},
45 .forbid_flags = {.count = 0, .items = NULL},
38 }; 46 };
39 return tmp; 47 return tmp;
40} 48}