bundles/icinga2: use ip addresses for monitoring instead of hostnames
Some checks failed
kunsi/bundlewrap/pipeline/head There was a failure building this commit

This commit is contained in:
Franzi 2022-03-13 15:15:47 +01:00
parent 5179edb458
commit 7604fef734
Signed by: kunsi
GPG key ID: 12E3D2136B818350
3 changed files with 32 additions and 5 deletions

View file

@ -9,7 +9,7 @@ object CheckCommand "sshmon" {
value = "$sshmon_command$"
}
"-h" = {
value = "$address$"
value = "$check_address$"
}
"-t" = {
set_if = bool("$sshmon_timeout$")
@ -81,7 +81,7 @@ object CheckCommand "check_imap" {
value = "$imap_port$"
}
"-H" = {
value = "$address$"
value = "$check_address$"
}
}
}
@ -108,7 +108,7 @@ object CheckCommand "check_smtp" {
arguments = {
"-H" = {
value = "$address$"
value = "$check_address$"
}
}
}
@ -124,6 +124,6 @@ object CheckCommand "check_usv" {
import "plugin-check-command"
import "ipv4-or-ipv6"
command = [ "/usr/local/share/icinga/plugins/check_usv_snmp", "$address$", "$snmp_community$" ]
command = [ "/usr/local/share/icinga/plugins/check_usv_snmp", "$check_address$", "$snmp_community$" ]
vars.snmp_community = "public"
}

View file

@ -1,7 +1,12 @@
object Host "${rnode.name}" {
import "generic-host"
address = "${rnode.metadata.get('icinga_options/hostname', rnode.hostname)}"
% if address4:
address = "${address4}"
% endif
% if address6:
address6 = "${address6}"
% endif
# used for determining service groups
vars.bw_groups = [ "${'", "'.join(sorted({group.name for group in rnode.groups}))}" ]