mirror of https://github.com/Icinga/icinga2.git
Add attributes to the "dns" CheckCommand
fixes #9145 Signed-off-by: Gunnar Beutner <gunnar@beutner.name>
This commit is contained in:
parent
f7bf5281cb
commit
5302ce0fe3
|
@ -181,11 +181,14 @@ Custom attributes passed as [command parameters](3-monitoring-basics.md#command-
|
|||
|
||||
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
|
||||
|
|
|
@ -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" {
|
||||
|
|
Loading…
Reference in New Issue