Created
November 26, 2017 08:15
-
-
Save bgta/043820bde2d1ea4589b7a0a910329cd9 to your computer and use it in GitHub Desktop.
Send a Telegram message using telegram-cli when low disk detected
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/env bash | |
FREE=`df --output=pcent -h "/dev/sdc1" | sed '1d;s/[^0-9]//g'` | |
if [[ $FREE -gt 98 ]]; then | |
# more than 98% used | |
echo "ALERT! More than 98% used" | |
telegram-cli -W -e "msg YOURCHANNEL ALERT! More than 98% used!" | |
fi; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment