add status to title, and Assume that the summary is the message, and that the alertname is a very short concise name for the alert

This commit is contained in:
Cameron Davison 2015-05-18 15:53:28 -05:00
parent 82ced0dc2a
commit ac2e3be7b7

View File

@ -444,10 +444,19 @@ func (n *notifier) sendPushoverNotification(token string, op notificationOp, use
return err
}
status := "unknown"
switch op {
case notificationOpTrigger:
status = "firing"
case notificationOpResolve:
status = "resolved"
}
alertname := html.EscapeString(a.Labels["alertname"])
// Send pushover message
_, _, err = po.Push(&pushover.Message{
Title: a.Summary,
Message: a.Description,
Title: fmt.Sprintf("%s: %s", alertname, status),
Message: a.Summary,
})
return err
}