Bosun未能向配置有以下日志的邮件发送警报通知。
错误: notify.go:111:未能将警报high.cpu{host=}发送到[*@gmail.com] EOF
这是我的bosun.conf
tsdbHost = localhost:4242
stateFile = /data/bosun.state
ledisBindAddr = 0.0.0.0:9565
smtpHost = smtp.gmail.com:465
emailFrom = bosun-alert@noreply.com
notification email {
email = ***@gmail.com
next = email
timeout = 5s
print = true
}
template test {
subject = {{.Last.Status}}: {{.Alert.Name}} on {{.Group.host}}
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 }}
<hr>
<p><strong>Relevant Tags</strong>
<table>
{{range $k, $v := .Group}}
<tr><td>{{$k}}</td><td>{{$v}}</td></tr>
{{end}}
</table>`
}
alert high.cpu {
template = test
$metric = q("sum:rate{counter,,1}:os.cpu{host=*}", "1h", "")
$avgcpu = avg($metric)
crit = $avgcpu > 3
warn = $avgcpu > 2
critNotification = email
warnNotification = email
}请帮我弄清楚我做错了什么。
发布于 2016-07-01 22:05:57
您的bosun配置中也有smtpUsername和smtpPassword吗?如果没有这些,您可能无法使用Bosun电子邮件通知。该电子邮件也可能被拒绝,除非它符合您的gmail地址或已在您的gmail帐户验证。我相信我们用端口587来做smtp.gmail.com,而不是465个。
示例:
smtpHost = smtp.gmail.com:587
emailFrom = youraccount@gmail.com
smtpUsername= youraccount@gmail.com
smtpPassword= yourpasswordhttps://stackoverflow.com/questions/38152168
复制相似问题