diff --git a/bundles/icinga2/files/icinga2/services_template.conf b/bundles/icinga2/files/icinga2/services_template.conf index 1450bfe..76a8ff0 100644 --- a/bundles/icinga2/files/icinga2/services_template.conf +++ b/bundles/icinga2/files/icinga2/services_template.conf @@ -4,7 +4,7 @@ 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 k not in {'import', 'command_on_monitored_host'} and not k.startswith('vars.notification'): % if isinstance(v, bool) or isinstance(v, int) or k in ["check_interval", "retry_interval"]: ${k} = ${str(v).lower()} % elif isinstance(v, list): @@ -16,6 +16,7 @@ object Service "${service}" { % endfor vars.bundle = "${bundle_name}" vars.notification.sms = ${str(config.get('vars.notification.sms', False)).lower()} + vars.notification.mail = ${str(config.get('vars.notification.mail', False)).lower()} } % endfor % endfor diff --git a/bundles/icinga2/metadata.py b/bundles/icinga2/metadata.py index 91ce91d..25571ed 100644 --- a/bundles/icinga2/metadata.py +++ b/bundles/icinga2/metadata.py @@ -36,6 +36,7 @@ defaults = { 'SIPGATE ACCOUNT BALANCE': { 'check_command': 'check_sipgate_account_balance', 'check_interval': '30m', + 'vars.notification.mail': True, }, }, },