Alert on a disk filling up
Logs or backup files eat /var; in 24 hours the server falls over. A basic df check every 10 minutes saves a 2 AM incident.
Recipe
bash
#!/usr/bin/env bash
# /etc/cron.d/disk-watch — */10 * * * * root /opt/disk-watch.sh
THRESHOLD=${THRESHOLD:-85}
while read -r FS USED MOUNT; do
USED=${USED%\%}
if [ "$USED" -ge "$THRESHOLD" ]; then
curl -X POST "$SLACK_WEBHOOK" \
--data "{\"text\":\"$(hostname): $MOUNT at ${USED}% (was ≥ $THRESHOLD)\"}"
fi
done < <(df -P -x tmpfs -x devtmpfs | awk 'NR>1 {print $1, $5, $6}')
Same thing in Enterno.io
The cron job itself should ping an Enterno heartbeat — if your script silently dies before checking the disk, Enterno still alerts because the ping never arrived.
Related recipes
Your cron silently stopped running. Need an alert when the script misses its window.
A container OOM-kills, the restart policy revives it — no external signal until users complain.
Ensure your site returns 2xx every minute, alert to Slack/Telegram on failure.