Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537
快速完成Prometheus搭建中,我們部署了alertmanager,但是并不能跑起來(lái)。接下來(lái)我們需要考慮是用slack通知,還是郵件通知。
# vi /etc/alertmanager/alertmanager.yml
# 全局配置項(xiàng)
global:
resolve_timeout: '5m' #處理超時(shí)時(shí)間,默認(rèn)為5min
smtp_smarthost: 'smtp.qq.com:587' # 郵箱smtp服務(wù)器代理
smtp_from: 'xxx@qq.com' # 發(fā)送郵箱名稱
smtp_auth_username: 'xxx@qq.com' # 郵箱名稱
smtp_auth_password: 'xxxxxxx' # 郵箱密碼或授權(quán)碼
smtp_require_tls: false
# 定義模板郵件
templates:
- '/etc/alertmanager/template/*.tmpl'
# 定義路由樹(shù)信息
route:
group_by: ['alertname'] # 報(bào)警分組依據(jù)
group_wait: 10s # 最初即第一次等待多久時(shí)間發(fā)送一組警報(bào)的通知
group_interval: 10s # 在發(fā)送新警報(bào)前的等待時(shí)間
repeat_interval: 5m # 發(fā)送重復(fù)警報(bào)的周期 對(duì)于email配置中,此項(xiàng)不可以設(shè)置過(guò)低,否則將會(huì)由于郵件發(fā)送太多頻繁,被smtp服務(wù)器拒絕
receiver: operations-team
# 定義警報(bào)接收者信息
receivers:
- name: 'operations-team'
email_configs: # 郵箱配置
- to: 'xxx@foxmail.com' # 接收警報(bào)的email配置
html: '{{ template "test.html" . }}' # 設(shè)定郵箱的內(nèi)容模板
headers: { Subject: "[WARN] 報(bào)警郵件"} # 接收郵件的標(biāo)題
slack_configs:
- api_url: "https://hooks.slack.com/services/TAX2D1UFK/B01GJE6SGV7/xxxxxxxxxxx"
channel: "#prometheus"
text: "{{ range .Alerts }} {{ .Annotations.description}}\n {{end}} {{ .CommonAnnotations.username}} "
title: "{{.CommonAnnotations.summary}}"
title_link: "{{.CommonAnnotations.link}}"
color: "{{.CommonAnnotations.color}}"
send_resolved: true
# 一個(gè)inhibition規(guī)則是在與另一組匹配器匹配的警報(bào)存在的條件下,使匹配一組匹配器的警報(bào)失效的規(guī)則。兩個(gè)警報(bào)必須具有一組相同的標(biāo)簽。
# 這里的critical 會(huì)抑制warning 規(guī)則, 比如磁盤使用率超過(guò)90%, 那80%的告警就不會(huì)發(fā)送通知。
inhibit_rules:
- source_match:
severity: 'critical'
target_match:
severity: 'warning'
equal: ['alertname','instance']
- source_match:
alertname: 'NodeFilesystemSpaceUsage'
severity: 'critical'
target_match:
severity: 'warning'
equal: ['alertname','instance']
說(shuō)明:
以上配置,會(huì)發(fā)送slack,同時(shí)發(fā)送郵件通知。如果只需要一個(gè),去掉不需要的即可。
inhibit_rules是我們配置的抑制規(guī)則。
郵件通知,我們使用了test.html模板。
重啟alertmanager
systemctl restart alertmanager
檢查下alertmanager頁(yè)面 http://192.168.0.107:9093/#/alerts ,如下界面說(shuō)明啟動(dòng)成功。
alertmanager
郵件通知模板/etc/alertmanager/template/test.html
{{ define "test.html" }}
<table border="1">
<tr>
<td>報(bào)警項(xiàng)</td>
<td>實(shí)例</td>
<td>概要</td>
<td>描述</td>
<td>開(kāi)始時(shí)間</td>
<td>link</td>
</tr>
{{ range $i, $alert := .Alerts }}
<tr>
<td>{{ .Labels.alertname }} </td>
<td>{{ .Labels.instance }} </td>
<td>{{ .Annotations.summary }}</td>
<td>{{ .Annotations.description }}</td>
<td>{{ .StartsAt.Format "2021-01-23 16:01:01" }}</td>
<td><a href="{{ .GeneratorURL }}">鏈接到Prometheus</a></td>
</tr>
{{ end }}
</table>
{{ end }}
獲取slack webhook地址
1.打開(kāi)https://slack.com/ ,注冊(cè)賬號(hào)
2.創(chuàng)建一個(gè)channel #prometheus
創(chuàng)建channel
3.添加APP
選中channel #prometheus
add an app
搜索"incoming-webhook",選中直接安裝即可。
incoming-webhook
在彈出的link里面找到 webhook URL
這個(gè)url 就是 alertmanager配置文件里面的api_url
api_url: "https://hooks.slack.com/services/TAX2D1UFK/B01GJE6SGV7/xxxxxxxxxxx"
slack 配置完成。
1.登陸QQ郵箱網(wǎng)頁(yè)版,點(diǎn)擊設(shè)置
獲取授權(quán)碼,填入alertmanager里smtp_auth_password
smtp_auth_password: 'xxxxxxx'
SLACK通知結(jié)果展示:
郵件通知結(jié)果展示:
ainglory虛榮國(guó)服已知BUG匯總,介紹Vainglory虛榮國(guó)服新手常見(jiàn)問(wèn)題有哪些?希望這篇Vainglory虛榮國(guó)服新手問(wèn)題匯總,能幫到虛榮新手玩家!
1.我是《虛榮》外服老玩家,我要想回家(轉(zhuǎn)回國(guó)服),現(xiàn)在如何操作?
方法一:在游戲“最近動(dòng)態(tài)”里點(diǎn)擊“國(guó)服不刪檔巨人接你回家”字樣的圖片進(jìn)入申請(qǐng)網(wǎng)站。
方法二:直接訪問(wèn)http://act.vg.ztgame.com/invite/public/填寫(xiě)資料(前提是您擁有《虛榮》外服帳號(hào))。
2. 如何判斷已經(jīng)轉(zhuǎn)入國(guó)服?
點(diǎn)擊主界面左下角等級(jí)名字,彈出界面右上角顯示“platform-cn:8020”表示轉(zhuǎn)服成功。
3. 我回家(轉(zhuǎn)回國(guó)服)了,需要重新下載客戶端嗎?
不需要,使用您在外服玩的老客戶端,登錄您成功轉(zhuǎn)服的帳號(hào)即可順利回歸國(guó)服
4. 國(guó)服測(cè)試分IOS或安卓系統(tǒng)嗎?
不分,您的帳號(hào)可以在IOS或安卓設(shè)備上登錄。
5. 我收到巨人短信是不是就代表我成功轉(zhuǎn)入國(guó)服了?
我 們是分批提交轉(zhuǎn)服申請(qǐng)的,如果您正確的填寫(xiě)了轉(zhuǎn)服申請(qǐng),請(qǐng)耐心等待。如果您收到“轉(zhuǎn)服已完成”字樣的巨人短信就說(shuō)明您已成功轉(zhuǎn)服,如果您沒(méi)有收到短信說(shuō)明 您的手機(jī)號(hào)碼填寫(xiě)錯(cuò)誤或轉(zhuǎn)服失敗(如果您沒(méi)收到短信可能是因?yàn)槟峤坏馁Y料有誤未能通過(guò)審核,您可繼續(xù)在頁(yè)面中再次提交正確的資料)
6. 我的號(hào)卡選英雄界面了怎么辦?
這是包括國(guó)際服在內(nèi)都有的一個(gè)游戲BUG,目前研發(fā)商已經(jīng)在緊急修復(fù)了,但是修復(fù)需要時(shí)間。現(xiàn)提供一個(gè)臨時(shí)解決方案:1.在后臺(tái)徹底關(guān)閉游戲。2.重新進(jìn)入游戲,開(kāi)始游戲,練習(xí),新手教程3.快速多次點(diǎn)擊新手教程,觸發(fā)卡屏。4.點(diǎn)擊上方退出教程,即可恢復(fù)正常游戲。
7. 為什么我玩國(guó)服還是很卡?
首先確認(rèn)您是否開(kāi)啟了VPN或網(wǎng)絡(luò)加速軟件、例如:云墻、快喵、蝸牛等等。國(guó)服是不用開(kāi)這些軟件的!然后確認(rèn)您的設(shè)備自動(dòng)獲取DNS地址(因?yàn)橛行┸浖?huì)更改DNS導(dǎo)致玩外服流暢玩國(guó)服卡),或者還原初始的DNS設(shè)置或更改為國(guó)內(nèi)DNS地址。
8. 為什么我的好友全沒(méi)有了?
轉(zhuǎn)服后您的好友信息會(huì)重置
9. 無(wú)法充值
游戲現(xiàn)在處于內(nèi)測(cè)階段,暫時(shí)未開(kāi)放充值相關(guān)內(nèi)容
10. 我是新人如何注冊(cè)帳號(hào)?
目前暫不能直接申請(qǐng)國(guó)服帳號(hào),玩家可以通過(guò)注冊(cè)外服帳號(hào)再轉(zhuǎn)回國(guó)服的方法體驗(yàn)。有熱心玩家分享的IOS的注冊(cè)教程http://tieba.baidu.com/p/4035488855有興趣的玩家可以試試,注冊(cè)好后還是需要填寫(xiě)咱們的轉(zhuǎn)服申請(qǐng)喲。
以上是小編為大家?guī)?lái)的vainglory虛榮國(guó)服新手問(wèn)題,希望這篇Vainglory虛榮國(guó)服已知BUG匯總,能幫到虛榮新手玩家!
更多更好的Vainglory虛榮攻略,請(qǐng)關(guān)注搞趣網(wǎng)Vainglory專區(qū)!
官方動(dòng)態(tài)|出裝推薦|精彩集錦|系統(tǒng)介紹|解說(shuō)視角|匹配對(duì)戰(zhàn)
賽事活動(dòng)|打野技巧|操作詳解|新手操作|入門引導(dǎo)|周免英雄
投稿地址:vg.gao7@foxmail.com
公告:為制作精彩鏡頭集錦,現(xiàn)征集玩家個(gè)人或所屬戰(zhàn)隊(duì)的精彩視頻鏡頭。大家可將精彩視頻與我們共享,標(biāo)明精彩鏡頭的時(shí)間。我們會(huì)收集每周最佳的鏡頭制成視頻集錦定期發(fā)布,精彩鏡頭會(huì)標(biāo)明玩家ID。
iOS點(diǎn)我 | 安卓點(diǎn)我
Vainglory虛榮玩家?jiàn)蕵?lè)開(kāi)黑群:97203374
戰(zhàn)隊(duì)招募推廣專用:http://bbs.gao7.com/thread-2340608-1-1.html
迎關(guān)注@程序員檸檬橙 回復(fù)「1024」獲取 10GB 編程學(xué)習(xí)資源!
*請(qǐng)認(rèn)真填寫(xiě)需求信息,我們會(huì)在24小時(shí)內(nèi)與您取得聯(lián)系。