bundlewrap/bundles/icinga2/files/icinga2/hosts.conf
Franziska Kunsmann b06532241b
All checks were successful
bundlewrap/pipeline/head This commit looks good
bundles: use metastack syntax for metadata.get()
2021-02-18 18:12:25 +01:00

21 lines
878 B
Text

% for monitored_node in sorted(monitored_nodes):
object Host "${monitored_node.name}" {
import "generic-host"
address = "${monitored_node.metadata.get('icinga_options/hostname', monitored_node.hostname)}"
vars.os = "${monitored_node.os}"
vars.sla = "${monitored_node.metadata.get('sla', '24x7')}"
vars.period = "${sla_info[monitored_node.metadata.get('sla', '24x7')]}"
vars.location = "${monitored_node.metadata.get('location', 'unknown')}"
vars.bw_groups = [ "${'", "'.join(sorted({group.name for group in monitored_node.groups}))}" ]
vars.notification.sms = ${str(monitored_node.metadata.get('icinga_options/vars.notification.sms', True)).lower()}
vars.notification.mail = true
}
% endfor
apply Dependency "disable-service-checks-on-host-down" to Service {
disable_checks = true
ignore_soft_states = true
assign where true
}