#!/bin/bash TOKEN=1680574249:AAFBmQ3WAvL7JpTOrZYZn9xldhoK1FHR1d4 CHAT_ID=-566367081 URL="https://api.telegram.org/bot1680574249:AAFBmQ3WAvL7JpTOrZYZn9xldhoK1FHR1d4/sendMessage" LIMIT=95 CACHE_LIMIT=60 MESSAGE="WARNING: Free Cache space has fallen below `expr 100 - $CACHE_USED`%. There is $CACHE_AVAIL_SPACE available." curl -s -X POST $URL -d chat_id="-566367081" -d "text=$MESSAGE" #curl -X POST "https://api.telegram.org/bot1680574249:AAFBmQ3WAvL7JpTOrZYZn9xldhoK1FHR1d4/sendMessage" -d "chat_id=-566367081" & "text=my sample text" # Checks how much space% is consumed on the array # ARRAY_USED_PERCENT=`df -h /mnt/user | awk '{print $5}' | sed -ne 2p | cut -d'%' -f1` # Checks how much available space there is in GB # ARRAY_AVAIL_SPACE=`df -h /mnt/user | awk '{print $4}' | sed -ne 2p` # Checks how much space% is consumed on the cache drive # CACHE_USED=`df -h /mnt/cache | awk '{print $5}' | sed -ne 2p | cut -d'%' -f1` # Checks how much available space there is in GB # CACHE_AVAIL_SPACE=`df -h /mnt/cache | awk '{print $4}' | sed -ne 2p` # if [ $ARRAY_USED_PERCENT -ge $LIMIT ] # then # MESSAGE="WARNING: Free Array Space is at `expr 100 - $ARRAY_USED_PERCENT`%. There is $ARRAY_AVAIL_SPACE available." # curl -s -X POST $URL -d chat_id=$CHAT_ID -d text="$MESSAGE" # fi # if [ $CACHE_USED -ge $CACHE_LIMIT ] # then # MESSAGE="WARNING: Free Cache space has fallen below `expr 100 - $CACHE_USED`%. There is $CACHE_AVAIL_SPACE available." # curl -s -X POST $URL -d chat_id=$CHAT_ID -d text="$MESSAGE" # fi