[icinga-checkins] icinga.org: icinga2/feature/improve-command-plugins-6487: Add CheckCommand "dns"

git at icinga.org git at icinga.org
Mon Jun 16 01:03:28 CEST 2014


Module: icinga2
Branch: feature/improve-command-plugins-6487
Commit: b5d8e9cfc60575224a2cc723bc00baa638511c38
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=b5d8e9cfc60575224a2cc723bc00baa638511c38

Author: Gerd von Egidy <gerd at egidy.de>
Date:   Mon Jun 16 01:03:08 2014 +0200

Add CheckCommand "dns"

Refs #6487

---

 doc/6-configuring-icinga-2.md |   13 +++++++++++++
 itl/command-plugins.conf      |   18 ++++++++++++++++++
 2 files changed, 31 insertions(+)

diff --git a/doc/6-configuring-icinga-2.md b/doc/6-configuring-icinga-2.md
index 537e1af..7a4586d 100644
--- a/doc/6-configuring-icinga-2.md
+++ b/doc/6-configuring-icinga-2.md
@@ -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:
diff --git a/itl/command-plugins.conf b/itl/command-plugins.conf
index 4ea1955..a0ef1db 100644
--- a/itl/command-plugins.conf
+++ b/itl/command-plugins.conf
@@ -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"
 



More information about the icinga-checkins mailing list