我一直试图让 Bosun 工作,但收效甚微。这是我的问题:
1) 我可以看到我的仪表板中出现的警报,但警报永远不会通过我选择的通知模式,无论是电子邮件、slack 还是 json。
2)当我在仪表板上确认警报时,只会收到来自通知链(第一个)的一个通知。即如果我设置{email -> slack -> json},只会收到电子邮件通知,没有slack和json。
任何帮助将不胜感激。下面是我的 dev.config
-------------- dev.conf ---------------
tsdbHost = qa1-sjc005-031:4242
emailFrom = bosun-alert@noreply.com
smtpHost = stmp.somedomain.com:25
checkFrequency = 1m
httpListen = :8070
# Post to an endpoint
notification json {
post = http://somedomain.com/HealthCheck/bosunAlert
body = {"text": {{.|json}}}
contentType = application/json
print = true
next = json
timeout = 5m
}
# Post to a Slack channel via Incoming Webhooks integration
notification slack {
post = https://hooks.slack.com/services/T03DNM0UU/B04QH37J6/ypn0
Uy2JwLa676soomXwItjq
body = payload={"channel": "#testing", "username": "webhookbot"
, "text" : "This is a test!"}
print = true
next = json
timeout = 5m
}
# Send out e-mail notification
notification email {
email = username@somedomain.com
print = true
next = slack
timeout = 5m
}
template test {
subject = {{.Last.Status}}: {{.Alert.Name}} on {{.Group.measurem
ent}} for {{.Group.pod}}
body = `<p>Name: {{.Alert.Name}}
<p>Tags:
<table>
{{range $k, $v := .Group}}
<tr><td>{{$k}}</td><td>{{$v}}</td></tr>
{{end}}
</table>`
}
alert test {
template = test
crit = avg(q("avg:mq1{measurement=*,pod=pod3}", "1h", ""))
warn = avg(q("avg:mq1{measurement=*,pod=pod3}", "30m", ""))
critNotification = email
warnNotification = email
}