mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 19:01:54 +00:00
56 lines
1.8 KiB
Django/Jinja
56 lines
1.8 KiB
Django/Jinja
# Alertmanager configuration — auto-generated by Ansible
|
|
# DO NOT edit manually; this Jinja2 template IS the source.
|
|
{% set email = lookup('email', application_id) %}
|
|
|
|
global:
|
|
smtp_smarthost: "{{ email.host }}:{{ email.port }}"
|
|
smtp_from: "{{ email['from'] }}"
|
|
smtp_hello: "{{ email.domain }}"
|
|
smtp_require_tls: {{ email.tls | bool | lower }}
|
|
{% if email.auth | bool %}
|
|
smtp_auth_username: "{{ email.username }}"
|
|
smtp_auth_password: "{{ email.password }}"
|
|
{% endif %}
|
|
resolve_timeout: 5m
|
|
|
|
route:
|
|
group_by: ["alertname", "app"]
|
|
group_wait: 30s
|
|
group_interval: 5m
|
|
repeat_interval: 4h
|
|
receiver: "default"
|
|
routes:
|
|
- matchers:
|
|
- severity = "critical"
|
|
repeat_interval: 1h
|
|
|
|
receivers:
|
|
- name: "default"
|
|
email_configs:
|
|
- to: "{{ lookup('users', 'administrator').email }}"
|
|
send_resolved: true
|
|
headers:
|
|
Subject: "[{{ '{{' }} .Status | toUpper {{ '}}' }}] {{ '{{' }} .CommonAnnotations.summary {{ '}}' }}"
|
|
{% if ALERTMANAGER_TELEGRAM_BOT_TOKEN and ALERTMANAGER_TELEGRAM_CHAT_ID | int > 0 %}
|
|
telegram_configs:
|
|
- api_url: "https://api.telegram.org"
|
|
bot_token: "{{ ALERTMANAGER_TELEGRAM_BOT_TOKEN }}"
|
|
chat_id: {{ ALERTMANAGER_TELEGRAM_CHAT_ID | int }}
|
|
send_resolved: true
|
|
parse_mode: "HTML"
|
|
{% endif %}
|
|
{% if ALERTMANAGER_MATTERMOST_WEBHOOK_URL and 'web-app-mattermost' in lookup('active_alertmanager_channels') %}
|
|
slack_configs:
|
|
- api_url: "{{ ALERTMANAGER_MATTERMOST_WEBHOOK_URL }}"
|
|
send_resolved: true
|
|
title: "[{{ '{{' }} .Status | toUpper {{ '}}' }}] {{ '{{' }} .CommonAnnotations.summary {{ '}}' }}"
|
|
text: "{{ '{{' }} .CommonAnnotations.description {{ '}}' }}"
|
|
{% endif %}
|
|
|
|
inhibit_rules:
|
|
- source_matchers:
|
|
- severity = "critical"
|
|
target_matchers:
|
|
- severity = "warning"
|
|
equal: ["alertname", "app"]
|