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 生日开业蛋糕祝福语简短