Skip to content

Instantly share code, notes, and snippets.

@buuhsmead
Created March 28, 2020 11:36
Show Gist options
  • Save buuhsmead/af430090084d4ffdda5985f12f1e340c to your computer and use it in GitHub Desktop.
Save buuhsmead/af430090084d4ffdda5985f12f1e340c to your computer and use it in GitHub Desktop.
webhook_config for watchdog from alertmanager
(openshift 4.3)
To configure a webhook_config for Watchdog of Alertmanager we have to adjust the secret alertmanager.yml.
# oc -n openshift-monitoring get secret alertmanager-main --template='{{ index .data "alertmanager.yaml" }}' | base64 -d > alertmanager.yaml
And then change alertmanager.yml into
global:
resolve_timeout: 5m
route:
group_wait: 30s
group_interval: 5m
repeat_interval: 12h
receiver: 'default'
routes:
- match:
alertname: 'Watchdog'
repeat_interval: 5m
receiver: 'watchdog'
receivers:
- name: 'default'
- name: 'watchdog'
webhook_configs:
- url: 'http://nagios.example.com:8000/'
And then replace alertmanager secret config
# oc -n openshift-monitoring create secret generic alertmanager-main --from-file=alertmanager.yaml --dry-run -o=yaml | oc -n openshift-monitoring replace secret --filename=-
tip: webhook_configs is not a typo, it must be plural.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment