docs(docker): Add /var space issue documentation and monitoring scripts

This commit is contained in:
goose 2026-02-15 15:18:21 -03:00
parent f0b5109f61
commit b0318430ad
4 changed files with 347 additions and 0 deletions

View file

@ -0,0 +1,40 @@
#!/bin/bash
# Monitor disk space on all filesystems
# Run this periodically to catch space issues early
echo "================================"
echo "Disk Space Check - $(date)"
echo "================================"
echo ""
# Check all filesystems
echo "All Filesystems:"
df -h
echo ""
# Check specifically /var
echo "/var Filesystem:"
df -h /var 2>/dev/null || echo "No separate /var filesystem"
echo ""
# Check Docker data location
echo "Docker Data Location:"
docker system info 2>/dev/null | grep "Docker Root Dir" || echo "Docker not accessible"
echo ""
# Check Docker space usage
echo "Docker Space Usage:"
docker system df 2>/dev/null || echo "Cannot get Docker stats"
echo ""
# Alert if any filesystem is > 90% full
echo "Alerts (filesystems > 90% full):"
df -h | awk 'NR>1 {gsub(/%/,""); if($5 > 90) print $6 " is " $5 "% full"}"
if [ $(df -h | awk 'NR>1 {gsub(/%/,""); if($5 > 90)}' | wc -l) -eq 0 ]; then
echo " No alerts"
fi
echo ""
echo "================================"
echo "Check complete"
echo "================================"