Skip to content

Commit a4a015c

Browse files
gvegidyMichael Friedrich
authored andcommitted
Add CheckCommand "dns"
Refs #6487
1 parent 2dc4b96 commit a4a015c

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

doc/6-configuring-icinga-2.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2079,6 +2079,19 @@ snmp_community | **Optional.** The SNMP community. Defaults to "public".
20792079

20802080
#### <a id="plugin-check-command-dhcp"></a> dhcp
20812081

2082+
Check command object for the `check_dns` plugin.
2083+
2084+
Custom Attributes:
2085+
2086+
Name | Description
2087+
---------------------|--------------
2088+
dns_lookup | **Optional.** The hostname or IP to query the dns for. Defaults to $host_name$.
2089+
dns_server | **Optional.** The DNS server to query. Defaults to the server configured in the OS.
2090+
dns_expected_answer | **Optional.** The answer to look for. A hostname must end with a dot.
2091+
dns_authorative | **Optional.** Expect the server to send an authorative answer.
2092+
2093+
#### <a id="plugin-check-command-dns"></a> dns
2094+
20822095
Check command object for the `check_dhcp` plugin.
20832096

20842097
Custom Attributes:

itl/command-plugins.conf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,24 @@ object CheckCommand "dhcp" {
423423
vars.dhcp_unicast = false
424424
}
425425

426+
object CheckCommand "dns" {
427+
import "plugin-check-command"
428+
429+
command = PluginDir + "/check_dns"
430+
431+
arguments = {
432+
"-H" = "$dns_lookup$",
433+
"-s" = "$dns_server$",
434+
"-a" = "$dns_expected_answer$",
435+
"-A" = {
436+
set_if = "$dns_authorative$"
437+
}
438+
}
439+
440+
vars.dns_lookup = "$host_name$"
441+
vars.dns_expected_answer = "$address$"
442+
}
443+
426444
object CheckCommand "nscp" {
427445
import "plugin-check-command"
428446

0 commit comments

Comments
 (0)