Add Slack and mail receiver to AlertManager config
Change-Id: Ib82ef0a7d029f84a7f92a90384bac02a0870b521
This commit is contained in:
parent
af5d9a9503
commit
7b14deaf31
3 changed files with 62 additions and 0 deletions
12
README.rst
12
README.rst
|
@ -121,6 +121,18 @@ Configure alertmanager
|
||||||
webhook_configs:
|
webhook_configs:
|
||||||
- url: http://127.0.0.1
|
- url: http://127.0.0.1
|
||||||
send_resolved: true
|
send_resolved: true
|
||||||
|
- name: 'HTTP-slack'
|
||||||
|
slack_configs:
|
||||||
|
- api_url: http://127.0.0.1/slack
|
||||||
|
send_resolved: true
|
||||||
|
- name: 'smtp'
|
||||||
|
email_configs:
|
||||||
|
- to: test@example.com
|
||||||
|
from: test@example.com
|
||||||
|
smarthost: example.com
|
||||||
|
auth_username: username
|
||||||
|
auth_password: password
|
||||||
|
send_resolved: true
|
||||||
|
|
||||||
Configure pushgateway
|
Configure pushgateway
|
||||||
---------------------
|
---------------------
|
||||||
|
|
|
@ -76,6 +76,44 @@ receivers:
|
||||||
send_resolved: {{ webhook.send_resolved | lower }}
|
send_resolved: {{ webhook.send_resolved | lower }}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
{%- elif config.slack_configs is defined %}
|
||||||
|
slack_configs:
|
||||||
|
{%- for name, slack in config.slack_configs.iteritems() %}
|
||||||
|
# {{ name }}
|
||||||
|
- api_url: {{ slack.api_url }}
|
||||||
|
{%- if slack.send_resolved is defined %}
|
||||||
|
send_resolved: {{ slack.send_resolved | lower }}
|
||||||
|
{%- endif %}
|
||||||
|
{%- if slack.channel is defined %}
|
||||||
|
channel: {{ slack.channel }}
|
||||||
|
{%- endif %}
|
||||||
|
{%- endfor %}
|
||||||
|
{%- elif config.email_configs is defined %}
|
||||||
|
email_configs:
|
||||||
|
{%- for name, email in config.email_configs.iteritems() %}
|
||||||
|
# {{ name }}
|
||||||
|
- to: {{ email.to }}
|
||||||
|
from: {{ email.from }}
|
||||||
|
smarthost: {{ email.smarthost }}
|
||||||
|
{%- if email.auth_username is defined %}
|
||||||
|
auth_username: '{{ email.auth_username }}'
|
||||||
|
{%- endif %}
|
||||||
|
{%- if email.auth_password is defined %}
|
||||||
|
auth_password: '{{ email.auth_password }}'
|
||||||
|
{%- endif %}
|
||||||
|
{%- if email.auth_secret is defined %}
|
||||||
|
auth_secret: '{{ email.auth_secret }}'
|
||||||
|
{%- endif %}
|
||||||
|
{%- if email.auth_identity is defined %}
|
||||||
|
auth_identity: '{{ email.auth_identity}}'
|
||||||
|
{%- endif %}
|
||||||
|
{%- if email.require_tls is defined %}
|
||||||
|
require_tls: {{ email.require_tls | lower }}
|
||||||
|
{%- endif %}
|
||||||
|
{%- if email.send_resolved is defined %}
|
||||||
|
send_resolved: {{ email.send_resolved | lower }}
|
||||||
|
{%- endif %}
|
||||||
|
{%- endfor %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
|
|
@ -38,6 +38,18 @@ prometheus:
|
||||||
webhook_configs:
|
webhook_configs:
|
||||||
- url: http://127.0.0.1
|
- url: http://127.0.0.1
|
||||||
send_resolved: true
|
send_resolved: true
|
||||||
|
- name: 'HTTP-slack'
|
||||||
|
slack_configs:
|
||||||
|
- api_url: http://127.0.0.1/slack
|
||||||
|
send_resolved: true
|
||||||
|
- name: 'smtp'
|
||||||
|
email_configs:
|
||||||
|
- to: test@example.com
|
||||||
|
from: test@example.com
|
||||||
|
smarthost: example.com
|
||||||
|
auth_username: username
|
||||||
|
auth_password: password
|
||||||
|
send_resolved: true
|
||||||
docker:
|
docker:
|
||||||
host:
|
host:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
Loading…
Reference in a new issue