jarland
The ocean is digital
Oh dear. The thought of letting a node get that low makes me cringe.#!/bin/sh
currentdisk=$(df -h | tail -n 2 | head -n 1 | awk '{print $4}' | awk -F"G" '{print $1}')
if (( $(echo $currentdisk) < 10 )); then
/bin/echo "$(hostname) is almost out of disk space" | /bin/mail -s "$(hostname) CHECK DISK SPACE" [email protected]
fi
Above script will email server admin when a Node has less than 10GB of available disk space left. Put it to hourly cron and that's it, will definitely come handy if you are overselling disk space.