From a4a015c8be3286f883567f309c7dc0caad4b04bb Mon Sep 17 00:00:00 2001 From: Gerd von Egidy Date: Mon, 16 Jun 2014 01:03:08 +0200 Subject: [PATCH] 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 64159e528..6e62142dc 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". #### 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. + +#### dns + Check command object for the `check_dhcp` plugin. Custom Attributes: diff --git a/itl/command-plugins.conf b/itl/command-plugins.conf index 4ea195568..a0ef1db70 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"