From fd42290d4a0aafd0d3c154cdd8fad53bfcc79046 Mon Sep 17 00:00:00 2001 From: Dennis <13968467+Decstasy@users.noreply.github.com> Date: Sat, 29 Nov 2025 15:24:52 +0100 Subject: check_dig: add -E/--require-flags and -X/--forbid-flags (#2165) * 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 --- plugins/check_dig.d/config.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'plugins/check_dig.d/config.h') 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 @@ -7,6 +7,11 @@ #define DEFAULT_PORT 53 #define DEFAULT_TRIES 2 +typedef struct { + char **items; + size_t count; +} flag_list; + typedef struct { char *query_address; char *record_type; @@ -19,6 +24,8 @@ typedef struct { double warning_interval; double critical_interval; + flag_list require_flags; + flag_list forbid_flags; } check_dig_config; check_dig_config check_dig_config_init() { @@ -34,7 +41,8 @@ check_dig_config check_dig_config_init() { .warning_interval = UNDEFINED, .critical_interval = UNDEFINED, - + .require_flags = {.count = 0, .items = NULL}, + .forbid_flags = {.count = 0, .items = NULL}, }; return tmp; } -- cgit v1.2.3-74-g34f1