Last active
February 2, 2017 16:31
-
-
Save esseti/5d81db337c186b3d4e4305339ad2bad7 to your computer and use it in GitHub Desktop.
Barman Notification on Slack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#this should be run in a cron task every day or week. | |
#fill in CHANNEL and WEBHOOK URL | |
RESULT="$(barman check all)" | |
RESULT2="$(barman list-backup all)" | |
PAYLOAD='payload={"channel": "<SPECIFY THE CHANNEL>","username": "barman","icon_emoji": ":robot_face:","color": "info","fields": [{"title": "Check","value": "'${RESULT}'","short": False},{"title": "list backup","value": "'${RESULT2}'","short": False}],}' | |
curl -X POST --data "$PAYLOAD" https://hooks.slack.com/services/<YOUR URL> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment