diff --git a/dicos/70_prometheus.xml b/dicos/70_prometheus.xml index 0dcbe3f..9d57761 100644 --- a/dicos/70_prometheus.xml +++ b/dicos/70_prometheus.xml @@ -103,6 +103,9 @@ + + non + @@ -211,6 +214,16 @@ ['','service','severity'] + + oui + alSMTPUser + alSMTPPass + alSMTPPort + alSMTPTLS + alSMTPHost + alSMTPAuth + + non alSMTPUser diff --git a/tmpl/alertmanager.yml b/tmpl/alertmanager.yml index 1acb668..e72e74c 100644 --- a/tmpl/alertmanager.yml +++ b/tmpl/alertmanager.yml @@ -1,16 +1,28 @@ global: # The smarthost and SMTP sender used for mail notifications. +%if %%alSMTPUseSys == 'oui' + %if %%tls_smtp == "non" + smtp_smarthost: '%%exim_relay_smtp:25' + %elif %%tls_smtp == "port 25" + smtp_smarthost: '%%exim_relay_smtp:25' + smtp_require_tls: true + %else + smtp_smarthost: '%%exim_relay_smtp:465' + smtp_require_tls: true + %end if +%else smtp_smarthost: '%%alSMTPHost:%%alSMTPPort' smtp_from: '%%alFrom' -%if %%getVar('alSMTPAuth','non') == 'oui' + %if %%getVar('alSMTPAuth','non') == 'oui' smtp_auth_username: '%%alSMTPUser' smtp_auth_password: 'alSMTPPass' -%end if + %end if -%if %%getVar('alSMTPTLS','non') == 'oui' + %if %%getVar('alSMTPTLS','non') == 'oui' smtp_require_tls: true -%else + %else smtp_require_tls: false + %end if %end if # The auth token for Hipchat.