Drop notifications when no alert manager URL is configured.

This commit is contained in:
Julius Volz 2013-07-30 23:06:38 +02:00 committed by Julius Volz
parent e969562b13
commit 24f4bb1f07
1 changed files with 3 additions and 0 deletions

View File

@ -98,6 +98,9 @@ func (n *NotificationHandler) sendNotifications(reqs rules.NotificationReqs) err
// Continusouly dispatch notifications.
func (n *NotificationHandler) Run() {
for reqs := range n.pendingNotifications {
if n.alertmanagerUrl == "" {
log.Println("No alert manager configured, not dispatching notification")
}
if err := n.sendNotifications(reqs); err != nil {
log.Println("Error sending notification:", err)
}