When disk usage breaches threshold, OnCallReady identifies the top space consumers, rotates stale logs, purges temp files, and verifies the volume is healthy — before any human is paged.
Fires on any alert containing disk-related keywords paired with severity indicators. Matches Datadog, CloudWatch, Prometheus, PagerDuty, and custom webhook payloads. Typical triggers: "Disk usage at 92% on prod-web-03", "Volume /data is full", "CRITICAL: Disk capacity exceeded on api-server-1".
Extracts host, volume path, and current usage percentage from the alert payload. Determines which filesystem is affected.
Scans /var/log, /tmp, application cache directories, and container overlay layers. Ranks directories by size to target the highest-impact cleanup actions first.
Compresses log files older than 24 hours using gzip. Removes rotated logs beyond the 7-day retention window. Preserves current active log files.
Clears /tmp directories of files untouched for >6 hours. Removes dangling Docker images and stopped containers if Docker is present. Purges package manager caches.
Re-checks disk usage. If below 80%, marks incident resolved and logs the bytes freed. If above 80%, escalates to on-call with full context and remediation log attached.
Disk usage at 93% on prod-web-03 (/dev/sda1)CRITICAL: Volume /data is full on api-server-1Datadog: system.disk.in_use > 0.9 for >5m on host prod-db-3PagerDuty: Disk capacity exceeded on api-server-1 — CRITICALPrometheus: node_filesystem_avail_bytes < 2GB on /var/libCloudWatch: RDS FreeStorageSpace < 5GB on prod-pg-11. df -h — which filesystem is full? ├── /var/log partition → rotated logs not trimmed ├── /tmp partition → app temp files not cleaned └── root volume with /var/lib/docker → container overlay bloat 2. du -shx /* | sort -hr | head -10 └── Locate the top consumer directory 3. Check file recency: ├── find /var/log -mtime +7 -ls └── If > 5 GB of >7d logs → logrotate failed 4. Capacity relief: ├── Compress with gzip + remove >7d logs ├── Prune Docker: docker system prune -af --filter "until=72h" └── Last resort: expand the EBS volume + resize2fs
# 1. Identify what's eating the disk df -h sudo du -shx /* 2>/dev/null | sort -hr | head -10 # 2. Vacuum rotated journals sudo journalctl --vacuum-time=7d # 3. Compress and prune stale app logs sudo find /var/log -type f -name "*.log" -mtime +1 -exec gzip {} \; sudo find /var/log -type f -name "*.gz" -mtime +7 -delete # 4. Trim Docker overlay layers sudo docker system prune -af --filter "until=72h" # 5. Clear apt / yum caches sudo apt-get clean sudo yum clean all # 6. Verify usage is back below 80% df -h /
Our agent SSHes (or calls over SSM) to the affected host, runs df -h + du -shx /* | sort -hr | head, and ranks the candidate cleanup actions by expected bytes freed. It vacuums systemd journals, gzips stale app logs, prunes Docker overlays, and re-checks usage — escalating only if disk is still > 80% post-cleanup.
Drain disk pressure and stop the 3am pages. Connect OnCallReady today.