10 shell scripts for automated server health checks, backups, and monitoring.
**Scripts Included:**
1. health-check.sh โ CPU, RAM, Disk, Load, Uptime, Running services, Open ports, Failed SSH attempts, Reboot required flag. Output: colored terminal + JSON report.
2. disk-monitor.sh โ Watch disk usage over time, alert when over 80%, find large files, show growth rate. Can trigger webhook alert.
3. backup-rotate.sh โ Create timestamped backup, rotate old ones (keep last N), verify integrity with checksum, upload to remote (rsync/S3/SCP). Works with: directories, MySQL dumps, Docker volumes.
4. cert-expiry-check.sh โ Check SSL certificate expiry dates for domains. Alert when less than 30 days, critical when less than 7 days. Works with Let is Encrypt, custom certs, and remote domains.
5. service-watchdog.sh โ Monitor systemd service status, restart if failed, log incidents, send alert after N failures. Configurable per-service thresholds.
6. docker-cleanup.sh โ Remove unused images, containers, volumes, networks. Dry-run mode. Exclude patterns. Schedule-safe (will not remove running containers).
7. fail2ban-report.sh โ Parse fail2ban logs, show top banned IPs, ban/unban counts, jail statistics. Output: terminal table + CSV export.
8. nginx-log-analyzer.sh โ Parse access logs, top URLs, top IPs, status code distribution, 404 report, response time percentiles. Useful for SEO audits.
9. cron-health.sh โ Verify cron daemon running, check syntax of all crontabs, find jobs that have not run in expected interval, report broken commands.
10. uptime-report.sh โ Generate daily/weekly/monthly uptime summary from system logs. Show reboots, downtime events, availability percentage.
**Tech:** Bash, Shell, systemd, Docker, fail2ban, Nginx, cron, rsync, SCP
What You Get
- ๐ฆ Server Health Scripts Toolkit