bundlewrap/bundles/icinga2/files/icinga2/services_template.conf
Franzi d428572461
Some checks failed
bundlewrap/pipeline/head There was a failure building this commit
bundles/icinga2: add servicegroup for every service which has checks
2020-11-21 23:04:15 +01:00

22 lines
802 B
Plaintext

% for node_data, icingaconf in sorted(bundle_metadata.items()):
% for service, config in sorted(icingaconf.items()):
object Service "${service}" {
import "generic-service"
host_name = "${node_data.name}"
% for k, v in sorted(config.items()):
% if k != 'import' and k != 'command_on_monitored_host':
% if isinstance(v, bool) or isinstance(v, int) or k in ["check_interval", "retry_interval"]:
${k} = ${str(v).lower()}
% elif isinstance(v, list):
${k} = [${", ".join(['"' + i + '"' for i in v])}]
% else:
${k} = "${v}"
% endif
% endif
% endfor
vars.bundle = "${bundle_name}"
vars.notification.sms = ${str(config.get('vars.notification.sms', False)).lower()}
}
% endfor
% endfor