Files
shell-scripts/crons/storage-alert.sh
T
andrew b528568876 install to use pip certbot, instead of apt.
migrating to discord using block style.
2023-09-06 17:50:43 +00:00

24 lines
686 B
Bash
Executable File

#!/bin/bash
LOCATION=`dirname "$0"`
source "${LOCATION}/../config.sh"
COUNT=1
for index in "${!STORAGE_ALERT[@]}"; do
storage=`${LOCATION}/../storage.sh $index ${STORAGE_ALERT[$index]}`
alert=$?
if [[ "0" != "${alert}" ]]; then
echo "${storage} is below threshold ${STORAGE_ALERT[$index]}G"
${LOCATION}/../discord-if-distinct.sh block "storage-${COUNT}" "${storage} is below threshold ${STORAGE_ALERT[$index]}G"
else
echo "${storage} is above threshold ${STORAGE_ALERT[$index]}G"
${LOCATION}/../discord-if-distinct.sh block "storage-${COUNT}" "${storage} is above threshold ${STORAGE_ALERT[$index]}G"
fi
let "COUNT++"
done