bundlewrap/bundles/icinga2/files/icinga2/hosts.conf
Franzi 0bc4b5439c
Some checks failed
bundlewrap/pipeline/head There was a failure building this commit
bundles/icinga2: add hostgroup for every bw group
2020-11-21 22:46:29 +01:00

20 lines
717 B
Plaintext

% for monitored_node in sorted(monitored_nodes):
object Host "${monitored_node.name}" {
import "generic-host"
address = "${monitored_node.metadata.get('icinga_options', {}).get('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}))}" ]
}
% endfor
apply Dependency "disable-service-checks-on-host-down" to Service {
disable_checks = true
ignore_soft_states = true
assign where true
}