Grafana郵箱告警


1、grafana-server 配置 smtp 服務器

vim  /etc/grafana/grafana.ini
#修改一下內容
#################################### SMTP / Emailing ##########################
[smtp]
# 啟用 smtp
enabled = true
# 郵件服務器地址和端口
host = smtp.189.cn:465
# 發送告警郵件郵箱賬號
user = xuewenlong1993@189.cn
# 發送告警郵件郵箱密碼
password = xuewenlong
;cert_file =
;key_file =
;skip_verify = false
from_address = xuewenlong1993@189.cn
from_name = Grafana
# EHLO identity in SMTP dialog (defaults to instance_name)
ehlo_identity = dashboard.example.com
 
[emails]
;welcome_email_on_sign_up = false

2、重啟服務

systemctl restart grafana-server

3、配置郵件通知方式

 
 
保存發送測試郵件,配置完成

4、查看郵箱是否收到測試郵件

5、配置告警

 
1的意思為 Max Request time TOP 10 alert 每分鍾計算一次圖標數據 告警觸發持續兩分鍾發送郵件。
2的意思為 查詢A語句,5分鍾之前到現在的平均值大於500 則觸發告警。
配置告警方式
 

6、測試告警

為了告警並發送郵件 我把請求時間的數值設置為大於5 則觸發告警。
收到郵件為
下邊還配有圖片 圖片太大,就不展示了 。
 
雪文龍|xuewenlong


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM