Last active
April 24, 2017 19:57
-
-
Save stevenharradine/47c3ef8804a958c3bebede58474b7755 to your computer and use it in GitHub Desktop.
send disk usage to slack
This file contains hidden or 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
slacktoken="TOKEN/TOKEN/TOKEN" | |
slackchannel="#welcome" | |
hostname=`cat /etc/hostname` | |
diskspace=`/bin/df -h | /usr/bin/xargs -L 1 /bin/echo "\n"` | |
curl -X POST --data-urlencode 'payload={"channel": "$slackchannel", "username": "webhookbot", "text": "'"$hostname""\n""$diskspace"'", "icon_emoji": ":ghost:"}' https://hooks.slack.com/services/$slacktoken |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment