VPS Guardian
by @strouddustinn-bot
Autonomous VPS monitoring and auto-remediation — kills runaway procs, frees disk, restarts dead services, hardens security. Not alerts. Action.
clawhub install vps-guardian📖 About This Skill
name: vps-guardian description: Autonomous VPS monitoring and auto-remediation — kills runaway procs, frees disk, restarts dead services, hardens security. Not alerts. Action. tags: - vps - monitoring - remediation - security - automation - devops - self-healing category: devops
VPS Guardian — Self-Healing Server Agent
What It Does
VPS Guardian doesn't just alert you when something's wrong — it fixes it. An autonomous agent that monitors your VPS and takes action: killing runaway processes, freeing disk space, restarting dead services, and hardening security.
Philosophy: Alerts are for humans. Guardians act.
Quick Start
Install
# Download
sudo curl -o /usr/local/bin/vps-guardian https://raw.githubusercontent.com/vps-guardian/guardian/main/src/guardian.py
sudo chmod +x /usr/local/bin/vps-guardianConfigure (optional — defaults are sensible)
sudo cp /usr/local/bin/vps-guardian.conf.example /etc/vps-guardian.conf
Run
# One-shot scan + remediate
vps-guardian --scanDaemon mode (continuous monitoring)
vps-guardian --daemonDry run (report only, no action)
vps-guardian --dry-run
Schedule with Cron
# Every 5 minutes
*/5 * * * * /usr/local/bin/vps-guardian --scan >> /var/log/vps-guardian.log 2>&1
What It Fixes
1. Runaway Processes
2. Disk Space Recovery
3. Dead Service Restart
systemctl restart up to 3 times4. Security Hardening
5. Memory Recovery
Configuration
# /etc/vps-guardian.conf[thresholds]
cpu_kill_percent = 90
cpu_kill_duration = 300
disk_warn_percent = 80
disk_act_percent = 90
memory_act_percent = 90
zombie_kill = true
[services]
Services to auto-restart when down
critical = ssh, cron, systemd-resolved, rsyslog
Services to monitor but NOT auto-restart
watched = nginx, docker, fail2ban[security]
block_bruteforce = true
max_ssh_failures = 10
scan_suspicious_procs = true
auto_block = false # Always requires approval
[cleanup]
rotate_logs_days = 7
tmp_max_age_days = 3
journal_max_size_mb = 500
apt_cache_clean = true
[alerts]
telegram_bot_token =
telegram_chat_id =
webhook_url =
Exit Codes
| Code | Meaning | |------|---------| | 0 | Healthy — no issues found | | 1 | Remediated — fixed issues, all clear now | | 2 | Critical — unrecoverable issues remain | | 3 | Error — guardian itself failed |
Logging
All actions are logged with before/after state:
[2026-04-17T06:30:00Z] RUNAWAY pid=4523 cmd="node server.js" cpu=94.2% mem=1.2G duration=420s → SIGTERM → exited
[2026-04-17T06:30:05Z] DISK / 92% → rotated /var/log/syslog.1 (freed 340MB) → 87%
[2026-04-17T06:30:10Z] SERVICE ssh: inactive → restarted → active
[2026-04-17T06:30:15Z] SECURITY 5 SSH failures from 45.33.xx.xx → blocked via iptables
Safety Mechanisms
--dry-run shows what would happen without actingRequirements
Differences from Monitoring Tools
| Feature | Traditional Monitoring | VPS Guardian | |---------|----------------------|--------------| | Detects issues | Yes | Yes | | Sends alerts | Yes | Yes | | Fixes issues | No | Yes | | Requires human | Yes | No (configurable) | | Runs autonomously | No | Yes | | Learns baselines | Sometimes | Yes (over time) |
Support
💡 Examples
Install
# Download
sudo curl -o /usr/local/bin/vps-guardian https://raw.githubusercontent.com/vps-guardian/guardian/main/src/guardian.py
sudo chmod +x /usr/local/bin/vps-guardianConfigure (optional — defaults are sensible)
sudo cp /usr/local/bin/vps-guardian.conf.example /etc/vps-guardian.conf
Run
# One-shot scan + remediate
vps-guardian --scanDaemon mode (continuous monitoring)
vps-guardian --daemonDry run (report only, no action)
vps-guardian --dry-run
Schedule with Cron
# Every 5 minutes
*/5 * * * * /usr/local/bin/vps-guardian --scan >> /var/log/vps-guardian.log 2>&1
⚙️ Configuration
# /etc/vps-guardian.conf[thresholds]
cpu_kill_percent = 90
cpu_kill_duration = 300
disk_warn_percent = 80
disk_act_percent = 90
memory_act_percent = 90
zombie_kill = true
[services]
Services to auto-restart when down
critical = ssh, cron, systemd-resolved, rsyslog
Services to monitor but NOT auto-restart
watched = nginx, docker, fail2ban[security]
block_bruteforce = true
max_ssh_failures = 10
scan_suspicious_procs = true
auto_block = false # Always requires approval
[cleanup]
rotate_logs_days = 7
tmp_max_age_days = 3
journal_max_size_mb = 500
apt_cache_clean = true
[alerts]
telegram_bot_token =
telegram_chat_id =
webhook_url =