wawa
wawa

Reputation: 626

when receive Prometheus's alert, how can do something for the machine

I use promethus,and when I receive alert, may be machine A's service was down. Now, I want do something for machine A,like restart the service,has any LIB can do it?

Upvotes: 1

Views: 628

Answers (1)

Alin Sînpălean
Alin Sînpălean

Reputation: 10064

Here's a webhook receiver (HTTP server that you can point Alertmanager at) that is supposed to run arbitrary commands when an alert triggers: https://github.com/imgix/prometheus-am-executor

Haven't used it myself, but it should be a simple tool so I don't see why it wouldn't work as advertised.

You will probably need to have it running on the machine where you want to restart the service though. For every machine that you want to do automatic restarts.

Upvotes: 1

Related Questions