]> granicus.if.org Git - icinga2/commitdiff
Add CheckCommand "dns"
authorGerd von Egidy <gerd@egidy.de>
Sun, 15 Jun 2014 23:03:08 +0000 (01:03 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Mon, 16 Jun 2014 06:49:52 +0000 (08:49 +0200)
Refs #6487

doc/6-configuring-icinga-2.md
itl/command-plugins.conf

index 64159e5282d7b7e96d3182e8b1c3f06e3c8e35f2..6e62142dcfe164178bcee34103e270e161994547 100644 (file)
@@ -2079,6 +2079,19 @@ snmp_community  | **Optional.** The SNMP community. Defaults to "public".
 
 #### <a id="plugin-check-command-dhcp"></a> dhcp
 
+Check command object for the `check_dns` plugin.
+
+Custom Attributes:
+
+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_expected_answer  | **Optional.** The answer to look for. A hostname must end with a dot.
+dns_authorative      | **Optional.** Expect the server to send an authorative answer.
+
+#### <a id="plugin-check-command-dns"></a> dns
+
 Check command object for the `check_dhcp` plugin.
 
 Custom Attributes:
index 4ea1955682c19e5ae0fe3edde1660a0097765c36..a0ef1db70741c1e577ea124625831ac60423d480 100644 (file)
@@ -423,6 +423,24 @@ object CheckCommand "dhcp" {
        vars.dhcp_unicast = false
 }
 
+object CheckCommand "dns" {
+       import "plugin-check-command"
+
+       command = PluginDir + "/check_dns"
+
+       arguments = {
+               "-H" = "$dns_lookup$",
+               "-s" = "$dns_server$",
+               "-a" = "$dns_expected_answer$",
+               "-A" = {
+                       set_if = "$dns_authorative$"
+               }
+       }
+
+       vars.dns_lookup = "$host_name$"
+       vars.dns_expected_answer = "$address$"
+}
+
 object CheckCommand "nscp" {
        import "plugin-check-command"