Please let me know if I can execute a shell script on the same server as Prometheus/alertmanager on an alert trigger? If so, help me with the configurations.
A maintained alternative is https://github.com/adnanh/webhook which allows you to install local webhooks with scripts attached.
Example config:
- id: redeploy-webhook
execute-command: "/var/scripts/redeploy.sh"
command-working-directory: "/var/webhook"
Default port of the webhook process is 9000, so the following URL would execute the redeploy.sh script from above config example.
http://yourserver:9000/hooks/redeploy-webhook
Which can be then used in your alertmanager config:
receivers:
- name: 'general'
webhook_config:
- url: http://yourserver:9000/hooks/redeploy-webhook
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With