From 2ccd8d732371966504ed8021e6539ee0500ac41b Mon Sep 17 00:00:00 2001 From: Zachary McGibbon Date: Thu, 2 Mar 2017 09:42:30 -0500 Subject: [PATCH] Add -q (query type) option for the dns check command fixes #5047 Signed-off-by: Gunnar Beutner --- doc/10-icinga-template-library.md | 1 + itl/command-plugins.conf | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/doc/10-icinga-template-library.md b/doc/10-icinga-template-library.md index 773e9a9ee..cf64b01cf 100644 --- a/doc/10-icinga-template-library.md +++ b/doc/10-icinga-template-library.md @@ -322,6 +322,7 @@ Name | Description ---------------------|-------------- dns_lookup | **Optional.** The hostname or IP to query the DNS for. Defaults to "$host_name$". dns_server | **Optional.** The DNS server to query. Defaults to the server configured in the OS. +dns_query_type | **Optional.** The DNS record query type where TYPE =(A, AAAA, SRV, TXT, MX, ANY). The default query type is 'A' (IPv4 host entry) dns_expected_answers | **Optional.** The answer(s) to look for. A hostname must end with a dot. Multiple answers must be defined as array. dns_authoritative | **Optional.** Expect the server to send an authoritative answer. dns_wtime | **Optional.** Return warning if elapsed time exceeds value. diff --git a/itl/command-plugins.conf b/itl/command-plugins.conf index ad86630ac..56995f877 100644 --- a/itl/command-plugins.conf +++ b/itl/command-plugins.conf @@ -1532,6 +1532,10 @@ object CheckCommand "dns" { value = "$dns_server$" description = "Optional DNS server you want to use for the lookup." } + "-q" = { + value = "$dns_query_type$" + description = "Optional DNS record query type where TYPE =(A, AAAA, SRV, TXT, MX, ANY). The default query type is 'A' (IPv4 host entry)" + } "-a" = { value = "$dns_expected_answers$" description = "Optional ip address or host you expect the DNS server to return. Host must end with a dot (.). This option can be repeated multiple times (Returns OK if any value match). If multiple addresses are returned at once, you have to match the whole string of addresses separated with commas (sorted alphabetically)." @@ -1554,6 +1558,7 @@ object CheckCommand "dns" { } vars.dns_lookup = "$host.name$" + vars.dns_query_type = "A" vars.dns_timeout = 10 }