1

我一直试图让 Bosun 工作,但收效甚微。这是我的问题:

1) 我可以看到我的仪表板中出现的警报,但警报永远不会通过我选择的通知模式,无论是电子邮件、slack 还是 json。

2)当我在仪表板上确认警报时,只会收到来自通知链(第一个)的一个通知。即如果我设置{email -> slack -> json},只会收到电子邮件通知,没有slack和json。

任何帮助将不胜感激。下面是我的 dev.config

    -------------- dev.conf ---------------

    tsdbHost = qa1-sjc005-031:4242
    emailFrom = bosun-alert@noreply.com
    smtpHost = stmp.somedomain.com:25
    checkFrequency = 1m
    httpListen = :8070

    # Post to an endpoint
    notification json {
            post = http://somedomain.com/HealthCheck/bosunAlert
            body = {"text": {{.|json}}}
            contentType = application/json
            print = true
            next = json
            timeout = 5m

    }


    # Post to a Slack channel via Incoming Webhooks integration
    notification  slack {
            post = https://hooks.slack.com/services/T03DNM0UU/B04QH37J6/ypn0
                   Uy2JwLa676soomXwItjq
            body = payload={"channel":  "#testing", "username": "webhookbot"
                   , "text" : "This is a test!"}
            print = true
            next = json
            timeout = 5m

    }


    # Send out e-mail notification
    notification email {
            email = username@somedomain.com
            print = true
            next = slack
            timeout = 5m
    }

    template test {
            subject = {{.Last.Status}}: {{.Alert.Name}} on {{.Group.measurem
                      ent}} for {{.Group.pod}}
            body = `<p>Name: {{.Alert.Name}}
            <p>Tags:
            <table>
                    {{range $k, $v := .Group}}
                            <tr><td>{{$k}}</td><td>{{$v}}</td></tr>
                    {{end}}
            </table>`
    }



    alert test {
            template = test
            crit = avg(q("avg:mq1{measurement=*,pod=pod3}", "1h", ""))
            warn = avg(q("avg:mq1{measurement=*,pod=pod3}", "30m", ""))
            critNotification = email
            warnNotification = email
    }
4

1 回答 1

0

确认停止通知链。所以他们的目的实际上是为了升级事件;确认事件后升级停止。根据关于通知的文档:

通知
通知是要执行的链接操作。链接继续进行,直到链接结束或警报被确认。

似乎您可能希望同时发送到多个通知。为此,请酌情在 warnNotification 和/或 critNotification 中列出它们:

critNotification:以逗号分隔的通知列表,以在关键时触发。

这两句话都来自配置文档(文档目前组织得不是很好,所以我不怪你错过了其中任何一个)

于 2015-12-21T14:14:32.907 回答