fix
This commit is contained in:
@@ -12,8 +12,13 @@ while IFS= read -r line; do
|
|||||||
filesystem=$(echo "$line" | awk '{print $1}')
|
filesystem=$(echo "$line" | awk '{print $1}')
|
||||||
usage=$(echo "$line" | awk -F'%' '{print $1}')
|
usage=$(echo "$line" | awk -F'%' '{print $1}')
|
||||||
|
|
||||||
# Check if usage is above the threshold
|
# Check if usage is a number
|
||||||
if [ "$usage" -ge "$threshold" ]; then
|
if [[ $usage =~ ^[0-9]+$ ]]; then
|
||||||
echo "WARNING: Filesystem $filesystem is $usage% full!"
|
# Check if usage is above the threshold
|
||||||
|
if [ "$usage" -ge "$threshold" ]; then
|
||||||
|
echo "WARNING: Filesystem $filesystem is $usage% full!"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "WARNING: Unable to parse usage for filesystem $filesystem."
|
||||||
fi
|
fi
|
||||||
done <<< "$filesystems"
|
done <<< "$filesystems"
|
||||||
|
|||||||
Reference in New Issue
Block a user