xmpp-webhook

webhook to xmpp gateway (clone of https://github.com/opthomas-prime/xmpp-webhook/ with my own mods)
git clone https://git.e1e0.net/xmpp-webhook.git
Log | Files | Refs | README | LICENSE

commit 6ad4c4056ed4ceb5b2bd73faba0f7655534f5546
parent 288b4346b897c46dfc0f9077aa375da1ad747737
Author: Thomas Maier <contact@thomas-maier.net>
Date:   Tue, 26 Sep 2017 15:03:46 +0200

new grafana alert formatting

Diffstat:
Mhandler.go | 12++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/handler.go b/handler.go @@ -58,6 +58,14 @@ func grafanaParserFunc(r *http.Request) (string, error) { return "", err } - // contruct and return alert message - return alert.State + ": " + alert.Title + "/" + alert.Message + "(" + alert.RuleURL + ")", nil + // contruct alert message + var message string + switch alert.State { + case "ok": + message = "8-) " + alert.Title + default: + message = ":'-( " + alert.Title + "\n" + alert.Message + "\n" + alert.RuleURL + } + + return message, nil }