From fd9a7d2e00b2acf66ec9aa48d7f51daa817f3457 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Wed, 25 Jul 2018 21:14:47 +0200 Subject: check_dns: allow forcing complete match of all addresses --- NEWS | 1 + plugins/check_dns.c | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index ac06aa67..0848705c 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,7 @@ This file documents the major additions and syntax changes between releases. (IPv4 only). check_dns: allow for IPv6 RDNS check_dns: allow unsorted addresses + check_dns: allow forcing complete match of all addresses check_apt: add --only-critical switch check_apt: add -l/--list option to print packages diff --git a/plugins/check_dns.c b/plugins/check_dns.c index 75a9dcaa..25bd31dc 100644 --- a/plugins/check_dns.c +++ b/plugins/check_dns.c @@ -56,6 +56,7 @@ char **expected_address = NULL; int expected_address_cnt = 0; int expect_authority = FALSE; +int all_match = FALSE; thresholds *time_thresholds = NULL; static int @@ -228,6 +229,8 @@ main (int argc, char **argv) if (result == STATE_OK && expected_address_cnt > 0) { result = STATE_CRITICAL; temp_buffer = ""; + unsigned long expect_match = (1 << expected_address_cnt) - 1; + unsigned long addr_match = (1 << n_addresses) - 1; for (i=0; i