]> granicus.if.org Git - icinga2/commitdiff
Add attributes to the "dns" CheckCommand
authorTobias von der Krone <tobias.vonderkrone@profitbricks.com>
Tue, 21 Apr 2015 17:02:20 +0000 (19:02 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Wed, 22 Apr 2015 19:48:28 +0000 (21:48 +0200)
fixes #9145

Signed-off-by: Gunnar Beutner <gunnar@beutner.name>
doc/7-icinga-template-library.md
itl/command-plugins.conf

index 6de3f0e9657eeb5b477b411cc37781bc0d12b400..292d6a19f969630991f936e9632a9656d75625a6 100644 (file)
@@ -192,11 +192,14 @@ Custom Attributes:
 
 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.
 
 
 ## <a id="plugin-check-command-dummy"></a> dummy
index f393950b04b60a086cd3dee30c044ca099089905..0371724f5f9b13b9b11aaea5144e58b3260a2c0f 100644 (file)
@@ -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" {