prometheus / alertmanager

Prometheus Alertmanager
https://prometheus.io
Apache License 2.0
6.66k stars 2.16k forks source link

Multiple webhook in one receiver #943

Closed prasenforu closed 7 years ago

prasenforu commented 7 years ago

Platform kubernetes. Alertmanager 0.8.0

In my alertmanager configmap file I have receiver as follows

- name: 'email-n-webhook-pod'
      email_configs:
      - to: 'example@test.com'
        send_resolved: true
      webhook_configs:
      - url: http://172.30.200.104:9000/hooks/ose-podhook
      webhook_configs:
      - url: http://172.30.200.104:9000/hooks/ose-sn-hook

but when I am checking in alertmanager UI status page, I found following configuration

- name: email-n-webhook-pod
  email_configs:
  - send_resolved: true
    to: example@test.com
    from: xxxxx@gmail.com
    smarthost: smtp.gmail.com:587
    auth_username: xxxxx@gmail.com
    auth_password: <secret>
    headers:
      From: xxxxx@gmail.com
      Subject: '{{ template "email.default.subject" . }}'
      To: example@test.com
    html: '{{ template "email.default.html" . }}'
    require_tls: true
  webhook_configs:
  - send_resolved: true
    url: http://172.30.200.104:9000/hooks/ose-sn-hook

that mean alertmanager did not loaded first webhook - url: http://172.30.200.104:9000/hooks/ose-podhook

Looking for such configuration where I can define multiple webhook in one receiver as per my requirement.

NOTE : Alerrtmanager running perfectly, there is no error in Alerrtmanager container logs.

prasenforu commented 7 years ago

Found the solution.

Murryy79 commented 7 years ago

What is the solution if you can share. I am looking for same.. thanks.

prasenforu commented 7 years ago

I tried with webhook which will execute script.

In that script I call ServicesNow api using curl.

Murryy79 commented 7 years ago

Thanks @prasenforu. Would you share that webhook and api? I am totally new to this.

Murryy79 commented 7 years ago

Still not getting how you doing multiple webhook with one receiver. I am trying to send slack and email alerts with ServiceNow tickets. Also I am researching in how to add custom subject line in the email.

prasenforu commented 7 years ago

webhook_configs:

JustUse commented 3 years ago

also works , Thanks : )