Bosun 版本:Docker 0.6.0-pre
每当发生暴击或警告时,我都会尝试向我的网络服务器发送一个 http 请求。下面是我的配置
template test {
subject = {{.Last.Status}}: {{.Alert.Name}} on {{.Group.host}}
body = `<p>Name: {{.Alert.Name}}
<p>Tags:
<table>
{{range $k, $v := .Group}}
<tr><td>{{$k}}</td><td>{{$v}}</td></tr>
{{end}}
</table>`
}
notification testn {
# I can curl the below command successfully from Bosun docker container,
get = http://host.docker.internal:3000/openapi_bff/admin/bosun
}
alert cpu.is.too.high {
runEvery = 1
template = test
$metric = q("sum:rate{counter,,1}:os.cpu{host=*}", "1m", "")
$avgcpu = avg($metric)
warnNotification = testn
critNotification = testn
crit = $avgcpu > 0
warn = $avgcpu > 0
}
但是,该请求从未发送到我的服务器,并且我确实注意到弹出了一些奇怪的错误。
2021/08/08 17:03:43 info: notify.go:172: Batching and sending unknown notifications
2021/08/08 17:03:43 info: notify.go:202: Done sending unknown notifications
2021/08/08 17:03:44 error: interval.go:65: bosun.org/cmd/scollector/collectors.c_iostat_linux: cannot parse
在此先感谢您的帮助!