Module: check_mk
Branch: master
Commit: 6e5d3486835a50b84b1fc979ee3f86c6f64f59f3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6e5d3486835a50…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Jul 30 09:44:53 2015 +0200
Added example notification script for slack into the treasures
---
doc/treasures/notifications/slack | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/doc/treasures/notifications/slack b/doc/treasures/notifications/slack
new file mode 100755
index 0000000..585f582
--- /dev/null
+++ b/doc/treasures/notifications/slack
@@ -0,0 +1,14 @@
+#!/bin/bash
+# Notify via Slack
+
+# In order to use this script:
+# - copy it into your site into ~/local/share/check_mk/notificaions
+# - make sure it is executable
+# - adapt the variable TEXT= to your needs
+# - insert your correct Slack-URL into URL=
+# - create a notification rule that makes use of the new plugin
+
+TEXT="$NOTIFY_HOSTNAME: $NOTIFY_SERVICEDESC: $NOTIFY_SERVICESTATE
$NOTIFY_SERVICEOUTPUT"
+URL="https://hooks.slack.com/services/A08BZU3D0/B08C03CKQ/owiefjowiejfoweijfwoeiju"
+
+curl -X POST --data-urlencode 'payload={"channel": "#check_mk",
"username": "webhookbot", "text":
"'"$TEXT"'", "icon_emoji": ":ghost:"}'
"$URL"