From 72e686457c9f0f7115ce25cc3c2a4041cf4ce797 Mon Sep 17 00:00:00 2001 From: Alfred Krohmer Date: Mon, 11 Dec 2017 21:51:46 +0100 Subject: [PATCH 1/3] Add default message for Pushover notifications If the message field is left empty for Pushover notifications, the API will return an error. This adds a default message if the message would otherwise be empty. This fixes #8006. --- pkg/services/alerting/notifiers/pushover.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/services/alerting/notifiers/pushover.go b/pkg/services/alerting/notifiers/pushover.go index ecb4ed42e3e..0fe93424f63 100644 --- a/pkg/services/alerting/notifiers/pushover.go +++ b/pkg/services/alerting/notifiers/pushover.go @@ -129,6 +129,7 @@ func (this *PushoverNotifier) Notify(evalContext *alerting.EvalContext) error { this.log.Error("Failed get rule link", "error", err) return err } + message := evalContext.Rule.Message for idx, evt := range evalContext.EvalMatches { message += fmt.Sprintf("\n%s: %v", evt.Metric, evt.Value) @@ -142,6 +143,9 @@ func (this *PushoverNotifier) Notify(evalContext *alerting.EvalContext) error { if evalContext.ImagePublicUrl != "" { message += fmt.Sprintf("\nShow graph image", evalContext.ImagePublicUrl) } + if message == "" { + message = "Nothing to see here! (Set a notification message to replace this text.)" + } q := url.Values{} q.Add("user", this.UserKey) From 8055dcae44419dd1dde7cd53a7f6d8aa8cceb7e8 Mon Sep 17 00:00:00 2001 From: Carl Bergquist Date: Tue, 19 Dec 2017 14:02:06 +0100 Subject: [PATCH 2/3] delete unused icon files --- "public/img/icons_dark_theme/Icon\r" | 0 "public/img/icons_light_theme/Icon\r" | 0 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 "public/img/icons_dark_theme/Icon\r" delete mode 100644 "public/img/icons_light_theme/Icon\r" diff --git "a/public/img/icons_dark_theme/Icon\r" "b/public/img/icons_dark_theme/Icon\r" deleted file mode 100644 index e69de29bb2d..00000000000 diff --git "a/public/img/icons_light_theme/Icon\r" "b/public/img/icons_light_theme/Icon\r" deleted file mode 100644 index e69de29bb2d..00000000000 From e2be6a38c49d53f8cc36e3ea25d02953f6705d16 Mon Sep 17 00:00:00 2001 From: Carl Bergquist Date: Tue, 19 Dec 2017 14:31:14 +0100 Subject: [PATCH 3/3] pushover: update default message --- pkg/services/alerting/notifiers/pushover.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/services/alerting/notifiers/pushover.go b/pkg/services/alerting/notifiers/pushover.go index 5caef5437bf..067c02a4a5d 100644 --- a/pkg/services/alerting/notifiers/pushover.go +++ b/pkg/services/alerting/notifiers/pushover.go @@ -148,7 +148,7 @@ func (this *PushoverNotifier) Notify(evalContext *alerting.EvalContext) error { message += fmt.Sprintf("\nShow graph image", evalContext.ImagePublicUrl) } if message == "" { - message = "Nothing to see here! (Set a notification message to replace this text.)" + message = "Notification message missing (Set a notification message to replace this text.)" } q := url.Values{}