This commit is contained in:
Oleg Sheynin 2024-06-13 18:03:43 -04:00
parent 80bbf47755
commit 180e3f89cf
2 changed files with 6 additions and 3 deletions

View File

@ -1 +1 @@
0.8.1 0.8.1.1

View File

@ -38,12 +38,15 @@ Metrics=()
function space_alert() { function space_alert() {
ALERT_USAGE=75% ALERT_USAGE=75%
for ln in "${Measurements[@]}" for metric in "${Metrics[@]}"
do do
IFS=$' '; args=($ln); unset IFS IFS=$' '; args=($metric); unset IFS
host=${args[0]} host=${args[0]}
fs=${args[1]} fs=${args[1]}
space_used=${args[2]} space_used=${args[2]}
echo "if [ ${space_used%?} -ge ${ALERT_USAGE%?} ]; then" >&2
if [ ${space_used%?} -ge ${ALERT_USAGE%?} ]; then if [ ${space_used%?} -ge ${ALERT_USAGE%?} ]; then
echo ":red_circle: Filesystem **${host}:${fs}** is using **${space_used}** :red_circle:" echo ":red_circle: Filesystem **${host}:${fs}** is using **${space_used}** :red_circle:"
fi fi