Bosun Alert示例
示例
Bosun警报是使用自定义DSL在配置文件中定义的。它们使用函数来评估时间序列数据,并在警告或关键表达式非零时生成警报。警报使用模板在通知中包括其他信息,这些信息通常是电子邮件和/或HTTPPOST请求。
templatesample.alert{
body = `<p>Alert: {{.Alert.Name}} triggered on {{.Group.host}}
<hr>
<p><strong>Computation</strong>
<table>
{{range .Computations}}
<tr><td><a href="{{$.Expr .Text}}">{{.Text}}</a></td><td>{{.Value}}</td></tr>
{{end}}
</table>
<hr>
{{ .Graph .Alert.Vars.metric }}`
subject = {{.Last.Status}}: {{.Alert.Name}} cpu idle at {{.Alert.Vars.q | .E}}% on {{.Group.host}}
}
notificationsample.notification{
email = alerts@example.com
}
alertsample.alert{
template = sample.template
$q = avg(q("sum:rate:linux.cpu{host=*,type=idle}", "1m"))
crit = $q < 40
notification = sample.notification
}该警报将发送电子邮件,主题为过去1分钟内空闲CPU使用率平均不到40%的任何主机。此示例是“主机范围的”警报,但Bosun还支持群集,数据中心或全局范围的警报(有关更多详细信息,请参阅基础知识视频系列)。Critical:sample.alertcpuidleat25%onhostname
热门推荐
2 祝福语简短七夕
10 婚礼亲友祝福语简短幽默
11 元旦祝福语简短有深度
12 岁岁祝福语简短独特
13 员工对同事祝福语简短
14 给母校送花祝福语简短
15 新年送顾客祝福语简短
16 欢天喜地盖新房祝福语简短
17 女方回门宴简短祝福语
18 新婚祝福语简短句子