Grafana警示--通知渠道配置

來源:互聯網
上載者:User

標籤:not   href   處理   gateway   oca   cat   nta   ESS   eval   

最近研究了prometheus+grafana的系統監控,使用grafana的警示功能,grafana支援很多種通知渠道,下文記錄使用到的幾種notification channels,分別是email,kafka和webhook

官網文檔 http://docs.grafana.org/alerting/notifications/

  • 發送郵件

  修改smtp,找到%GRAFANA_HOME%/conf/defaults.ini(注windows環境)

[smtp]enabled = true  #開戶email發送配置host = smtp.xxx.com:25  #此處需要加上連接埠號碼user =username@xxx.com  #郵箱帳號# If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;"""password =1234567890    #郵箱密碼cert_file =key_file =skip_verify = true    #跳過校正from_address = [email protected]from_name = Grafanaehlo_identity =

 

  • kafka

向kafka發送訊息,需要kafka REST proxy,我使用的中介軟體是confluent,安裝過程沒什麼特別之外,配置(confluent_home/etc/kafka-rest/kafka-rest.properties)如下

#id=kafka-rest-test-server#schema.registry.url=http://localhost:8081#zookeeper.connect=localhost:2181#bootstrap.servers=PLAINTEXT://localhost:9092zookeeper.connect=xx.xx.xx.xx:2181bootstrap.servers=PLAINTEXT://xx.xx.xx.xx:9092

啟用kafka-rest服務

bin/kafka-rest-start ../etc/kafka-rest/kafka-rest.properties

添加notification channels

 點擊 “send test”按鈕,瀏覽kafka-rest服務,alert-gateway-test-1已經在kafka topic裡了,開發人員可消費kafka的訊息,進行後續(自訂)處理

 

 

  •  webhook(推薦)

 

 回調參數

{  "title": "My alert",  "ruleId": 1,  "ruleName": "Load peaking!",  "ruleUrl": "http://url.to.grafana/db/dashboard/my_dashboard?panelId=2",  "state": "alerting",  "imageUrl": "http://s3.image.url",  "message": "Load is peaking. Make sure the traffic is real and spin up more webfronts",  "evalMatches": [    {      "metric": "requests",      "tags": {},      "value": 122    }  ]}

 

 

更詳細說明,可以參考官網http://docs.grafana.org/alerting/notifications/

 

Grafana警示--通知渠道配置

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.