Bosun Linux绑定健康
示例
模板定义
templatelinux.bonding{
subject = {{.Last.Status}}: {{.Eval .Alert.Vars.by_host}} bad bond(s) on {{.Group.host}}
body = `{{template "header" .}}
<h2>Bond Status</h2>
<table>
<tr><th>Bond</th><th>Slave</th><th>Status</th></tr>
{{range $r := .EvalAll .Alert.Vars.slave_status}}
{{if eq $.Group.host .Group.host}}
<tr>
<td>{{$r.Group.bond}}</td>
<td>{{$r.Group.slave}}</td>
<td {{if lt $r.Value 1.0}} style="color: red;" {{end}}>{{$r.Value}}</td>
</tr>
{{end}}
{{end}}
</table>
`
}警报定义
alertlinux.bonding{
template = linux.bonding
macro = host_based
$notes = This alert triggers when a bond only has a single interface, or the status of a slave in the bond is not up
$slave_status = max(q("sum:linux.net.bond.slave.is_up{bond=*,host=*,slave=*}", "5m", ""))
$slave_status_by_bond = sum(t($slave_status, "host,bond"))
$slave_count = max(q("sum:linux.net.bond.slave.count{bond=*,host=*}", "5m", ""))
$no_good = $slave_status_by_bond < $slave_count || $slave_count < 2
$by_host = max(t($no_good, "host"))
warn = $by_host
}通知优先浏览
热门推荐
10 写春节祝福语简短的
11 中考祝福语给同学简短
12 升职加薪的祝福语简短
13 退休的祝福语简短精辟
14 对爸爸的简短祝福语
15 结婚的祝福语小众简短
16 金婚祝福语大全简短唯美
17 简短元宵节祝福语
18 过年送礼祝福语简短精辟