alertmanager+webhook發報警郵件(使用587端口):
webhook安裝:
go get github.com/prometheus/alertmanager/examples/webhook
啓動webhook(默認端口爲TCP 5001):
go/bin/webhook
webhookmail.py下載網址(需要手動複製其內容):
https://github.com/youerning/blog/tree/master/prometheus
使用(需要先安裝falcon python模塊,步驟略):
vi webhookmail.py
改下里面的郵箱配置,smtp端口使用的587,最後的服務端口可以改爲5002(默認爲80),ip爲127.0.0.1(默認爲0.0.0.0)
python webhookmail.py
vi alertmanager/alertmanager.yml
調整web.hook的url爲http://127.0.0.1:5002/(默認爲5001)
啓動alertmanager