diff --git a/doc/7-icinga-template-library.md b/doc/7-icinga-template-library.md index 9e6fde34a..5674eb5bc 100644 --- a/doc/7-icinga-template-library.md +++ b/doc/7-icinga-template-library.md @@ -181,11 +181,14 @@ Custom attributes passed as [command parameters](3-monitoring-basics.md#command- Name | Description ---------------------|-------------- -dns_lookup | **Optional.** The hostname or IP to query the DNS for. Defaults to $host_name$. +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_expected_answer | **Optional.** The answer to look for. A hostname must end with a dot. **Deprecated in 2.3.** 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. +dns_ctime | **Optional.** Return critical if elapsed time exceeds value. +dns_timeout | **Optional.** Seconds before connection times out. Defaults to 10. ## dummy diff --git a/itl/command-plugins.conf b/itl/command-plugins.conf index f393950b0..0371724f5 100644 --- a/itl/command-plugins.conf +++ b/itl/command-plugins.conf @@ -846,9 +846,18 @@ object CheckCommand "dns" { command = [ PluginDir + "/check_dns" ] arguments = { - "-H" = "$dns_lookup$" - "-s" = "$dns_server$" - "-a" = "$dns_expected_answers$" + "-H" = { + value = "$dns_lookup$" + description = "The name or address you want to query." + } + "-s" = { + value = "$dns_server$" + description = "Optional DNS server you want to use for the lookup." + } + "-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)." + } "-a_old" = { key = "-a" value ="$dns_expected_answer$" @@ -856,10 +865,23 @@ object CheckCommand "dns" { "-A" = { set_if = "$dns_authoritative$" } + "-w" = { + value = "$dns_wtime$" + description = "Return warning if elapsed time exceeds value." + } + "-c" = { + value = "$dns_ctime$" + description = "Return critical if elapsed time exceeds value." + } + "-t" = { + value = "$dns_timeout$" + description = "Seconds before connection times out. Defaults to 10." + } } vars.dns_lookup = "$host.name$" vars.dns_expected_answer = "$check_address$" + vars.dns_timeout = 10 } object CheckCommand "dig" {