add teams notif script

This commit is contained in:
Marius Pana 2020-07-24 15:11:18 +03:00
parent 9cec373203
commit 5a2432a0eb
1 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,22 @@
#!/bin/bash
# Notify via Microsoft Teams
# Has not been tested with bulking!
# - copy this script into ~/local/share/check_mk/notificaions
# - make sure it is executable
# - create a microsoft teams incoming webhook (https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook)
# - use the Notify via Microsoft Teams Notification Method in your notification rule
# Microsoft webhook:
1. Open the Channel and click the More Options button which appears as three dots at the top right of the window.
2. Select Connectors.
3. Scroll down to Incoming Webhook and click the Add button.
4. Choose a name you like for the connector as well as an image and finally click Create.
5. A new unique URI is automatically generated. Copy this URI string below in the URL variable.
<insert-your-webhook-url>.
TEXT="$NOTIFY_HOSTNAME: $NOTIFY_SERVICEDESC: $NOTIFY_SERVICESTATE $NOTIFY_SERVICEOUTPUT"
URL=""
curl -H "Content-Type: application/json" -d "{\"text\": \"$TEXT\"}" $URL -4