Merge pull request #64 from novilabs/pushover-status-notification

add status to pushover title
This commit is contained in:
Fabian Reinartz 2015-05-23 09:14:03 +02:00
commit 5b0e343ec4

View File

@ -501,10 +501,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
}