From f8749d7d6278926b3072a5707a45857e5839291f Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Tue, 23 Jul 2019 11:07:19 +0200 Subject: [PATCH] [prometheus] You're a bad spammer boy --- ansible.cfg | 4 ++-- .../templates/prometheus/alertmanager.yml.j2 | 21 +++++++++---------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/ansible.cfg b/ansible.cfg index 6afb07fa..8d528bd6 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -1,11 +1,11 @@ -# Crans Ansible configuration +# Ansible configuration [defaults] # Do not create .retry files retry_files_enabled = False -# Use Crans inventory +# Use inventory inventory = ./hosts # Custom header in templates diff --git a/roles/prometheus-alertmanager/templates/prometheus/alertmanager.yml.j2 b/roles/prometheus-alertmanager/templates/prometheus/alertmanager.yml.j2 index 44ceef73..2e2a8af1 100644 --- a/roles/prometheus-alertmanager/templates/prometheus/alertmanager.yml.j2 +++ b/roles/prometheus-alertmanager/templates/prometheus/alertmanager.yml.j2 @@ -1,12 +1,16 @@ # {{ ansible_managed }} +# See https://prometheus.io/docs/alerting/configuration/ for documentation. global: # The smarthost and SMTP sender used for mail notifications. - smtp_smarthost: 'smtp.adm.crans.org:25' - smtp_from: 'roots@crans.org' + smtp_smarthost: 'localhost:25' + smtp_from: 'alertmanager@example.org' #smtp_auth_username: 'alertmanager' #smtp_auth_password: 'password' - smtp_require_tls: false + # The auth token for Hipchat. + hipchat_auth_token: '1234556789' + # Alternative host for Hipchat. + hipchat_api_url: 'https://hipchat.foobar.org/' # The directory from which notification templates are read. templates: @@ -17,26 +21,24 @@ route: # The labels by which incoming alerts are grouped together. For example, # multiple alerts coming in for cluster=A and alertname=LatencyHigh would # be batched into a single group. - #group_by: ['alertname', 'cluster', 'service'] - group_by: [] # do not group for text chat + group_by: ['...'] # do not group for text chat # When a new group of alerts is created by an incoming alert, wait at # least 'group_wait' to send the initial notification. # This way ensures that you get multiple alerts for the same group that start # firing shortly after another are batched together on the first # notification. - group_wait: 1m + group_wait: 30s # When the first notification was sent, wait 'group_interval' to send a batch # of new alerts that started firing for that group. - group_interval: 1m + group_interval: 5m # If an alert has successfully been sent, wait 'repeat_interval' to # resend them. repeat_interval: 12h # A default receiver - #receiver: team-roots-mails receiver: webhook-ninjabot @@ -54,9 +56,6 @@ inhibit_rules: receivers: -- name: 'team-roots-mails' - email_configs: - - to: 'roots@crans.org' - name: 'webhook-ninjabot' webhook_configs: - url: 'http://zamok.adm.crans.org:5000/'