alertmanager+webhook發報警郵件(使用587端口)

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

./alertmanager/alertmanager --config-file=./alertmanager/alertmanager.yml

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章