溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

open-falcon 郵件告警配置

發(fā)布時(shí)間:2020-06-29 23:21:23 來源:網(wǎng)絡(luò) 閱讀:815 作者:xingzhehxiang 欄目:系統(tǒng)運(yùn)維

1、下載二進(jìn)制安裝包

cd?/home/work/go/src/github.com/open-falcon
?wget?https://dl.cactifans.com/open-falcon/falcon-mail-provider.tar.gz
mkdir?-p?falcon-mail-provider
tar?zxvf?falcon-mail-provider.tar.gz?-C?falcon-mail-provider
cd?falcon-mail-provider

2、配置文件修改

{
????"debug":?true,
????"http":?{
????????"listen":?"0.0.0.0:4000",
????????"token":?""
????},
????"smtp":?{
????????"addr":?"smtp.qiye.163.com:25",
????????"username":?"xxamp@xxamp.com",
????????"password":?"youpassword",
????????"from":?"xxamp@xxamp.com",
????????"tls":false,
????????"anonymous":false,
????????"skipVerify":true
????}
}

3、測試配置

./control?start
[root@mgr?falcon-mail-provider]#?./control?tail
2019/09/18?11:46:00?config.go:71:?load?configuration?file?cfg.json?successfully
2019/09/18?11:46:00?http.go:25:?http?listening?0.0.0.0:4000
[root@mgr?falcon-mail-provider]#?curl?http://127.0.0.1:4000/sender/mail?-d?"tos=xingzhenxiang@qq.com,xingzhenxiang@163.com&subject=xx&content=yy"
success
[root@mgr?falcon-mail-provider]#

4、配置alarm模塊的配置文件cfg.json,修改"mail": "http://127.0.0.1:4000/sender/mail"選項(xiàng)的url并重啟

?sed?-i?'s#http://127.0.0.1:10086/mail#http://127.0.0.1:4000/sender/mail#g'?alarm/config/cfg.json?
[root@mgr?open-falcon]#?cat?alarm/config/cfg.json????
{
????"log_level":?"debug",
????"http":?{
????????"enabled":?true,
????????"listen":?"0.0.0.0:9912"
????},
????"redis":?{
????????"addr":?"127.0.0.1:6379",
????????"maxIdle":?5,
????????"highQueues":?[
????????????"event:p0",
????????????"event:p1",
????????????"event:p2"
????????],
????????"lowQueues":?[
????????????"event:p3",
????????????"event:p4",
????????????"event:p5",
????????????"event:p6"
????????],
????????"userIMQueue":?"/queue/user/im",
????????"userSmsQueue":?"/queue/user/sms",
????????"userMailQueue":?"/queue/user/mail"
????},
????"api":?{
????????"im":?"http://127.0.0.1:10086/wechat",
????????"sms":?"http://127.0.0.1:10086/sms",
????????"mail":?"http://127.0.0.1:4000/sender/mail",
????????"dashboard":?"http://127.0.0.1:8081",
????????"plus_api":"http://127.0.0.1:8080",
????????"plus_api_token":?"default-token-used-in-server-side"
????},
????"falcon_portal":?{
????????"addr":?"root:@tcp(127.0.0.1:3306)/alarms?charset=utf8&loc=Local",
????????"idle":?10,
????????"max":?100
????},
????"worker":?{
????????"im":?10,
????????"sms":?10,
????????"mail":?50
????},
????"housekeeper":?{
????????"event_retention_days":?7,
????????"event_delete_batch":?100
????}
}
[root@mgr?open-falcon]#?./open-falcon?restart?alarm

5、配置報(bào)警模板

5.1 在紅框里面輸入模板名稱,并點(diǎn)擊+

open-falcon 郵件告警配置

5.2填寫具內(nèi)容

open-falcon 郵件告警配置open-falcon 郵件告警配置

6、配置監(jiān)控模板和hostgroup關(guān)聯(lián)

6.1

open-falcon 郵件告警配置

6.2

open-falcon 郵件告警配置

6.3

open-falcon 郵件告警配置

7、未恢復(fù)告警查看,綁定完成要等幾分鐘,建議十分鐘后查看

open-falcon 郵件告警配置

8、郵件信息,xx是測試郵件信息

open-falcon 郵件告警配置

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI