寻求有关配置 Bosun 的帮助。
我无法收到上班通知。我已经配置了 hipchat、pagerduty 和(稍后添加)打印通知类型,但都不起作用。为了让事情顺利进行,hipchat 工作了一两次,我不知道为什么。
警报以正确的主题显示在仪表板上,如果我在规则编辑器中测试警报,一切看起来都很好,模板主题和正文都可以,等等。
我的配置是这样的:
template hipchat {
subject = {{.Last.Status}}: {{.Alert.Name}} on {{.Group | len}} items
body = {"color":"red","message":"{{.Alert.Name}} is {{.Last.Status}}","notify":false,"message_format":"text"}
}
template pagerduty {
subject = "subject foo123"
}
notification print {
print = true
}
notification hipchat {
next = print
post = https://foo.hipchat.com/v2/room/123/notification?auth_token=the_token
body = {"color":"red","message":"foo123 {{.Alert.Name}} is {{.Last.Status}}","notify":false,"message_format":"text"}
contentType = application/json
}
notification pagerduty {
post = https://events.pagerduty.com/generic/2010-04-15/create_event.json
contentType = application/json
body = {"service_key": "the_key", "event_type": "trigger", "description": "foo123"}
next = print
}
alert foo.bar.error {
template = pagerduty
$notes = "This is bad."
$data = lscount("logstash", "foo", "bar:baz", "1s", "10m", "1m")
$total = sum($data)
warn = $total > 0
crit = $total > 5
warnNotification = hipchat
critNotification = pagerduty
#unknownIsNormal = true # this doesn't work too
}