Ambari服務郵箱告警

1、登錄ambari管理頁面,找到Manage Notifications選項

2、創建告警

3、配置告警

4、163郵箱授權碼設置

5、修改郵件標題

(若沒特殊需求,可忽略)

  • 下載 alert-templates.xml https://raw.githubusercontent.com/apache/ambari/branch-2.5/ambari-server/src/main/resources/alert-templates.xml

注意:下面這些操作都是在ambari安裝節點上進行的

  • 編輯alert-templates.xml

找到<alert-template type="EMAIL">標籤,修改裏面內容

原內容:
<![CDATA[Alert Summary: OK[$summary.getOkCount()], Warning[$summary.getWarningCount()], Critical[$summary.getCriticalCount()], Unknown[$summary.getUnknownCount()]]]>

修改爲:
<![CDATA[xx數據--數據中心--Ambari監控報告:OK[$summary.getOkCount()], Warning[$summary.getWarningCount()], Critical[$summary.getCriticalCount()], Unknown[$summary.getUnknownCount()]]]>

  • 將alert-templates.xml移動到 /var/lib/ambari-server/resources/
  • 編輯/etc/ambari-server/conf/ambari.properties 文件

在文件最後一行增加 alerts.template.file=/var/lib/ambari-server/resources/alert-templates.xml

  • 重啓ambari server

ambari-server restart

  • 查看ambari server日誌

tail -f /var/log/ambari-server/ambari-server.log

6、查看報警信息

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