There's not really much to understand:

1. Alertmanager makes a HTTP connection to your webhook. The only mandatory 
configuration is "url", which is the URL where to send the webhook request 
to.
2. The documentation then shows the format of the webhook payload (body) 
which your webhook server will receive.

Therefore, all you need to do is to write a small web server in any 
language of your choice, which receives the webhook request, and acts on it 
however you want.

If you google for "alertmanager webhook run script" then you'll get the 
following as the first three hits:
https://github.com/prometheus/alertmanager/issues/2046
https://github.com/prometheus/alertmanager/issues/354
https://stackoverflow.com/questions/66811176/i-want-to-execute-shell-script-through-prometheus-alert-manger-when-ever-alert-m

which in turn will link you to some ready-made solutions:
https://github.com/adnanh/webhook
https://github.com/imgix/prometheus-am-executor

On Monday, 18 April 2022 at 07:46:02 UTC+1 [email protected] wrote:

> Hi,
>
> Can you please more details on this, I didn't understand the 
> webhook_config link.
>
> On Monday, 4 April 2022 at 23:08:53 UTC+5:30 Brian Candler wrote:
>
>> https://prometheus.io/docs/alerting/latest/configuration/#webhook_config
>>
>> You need to write your own webhook receiver, which will be a simple 
>> webserver, in a language of your choice.
>>
>> On Monday, 4 April 2022 at 17:11:33 UTC+1 [email protected] wrote:
>>
>>> Hi,
>>>
>>> Can you please help me with how to execute the script on alert triggers?
>>>
>>> Regards,
>>> Chanti
>>>
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/7f18dde3-9c2c-4da0-956b-c77f80c3cbfen%40googlegroups.com.

Reply via email to