SSH into a Docker-based VM and report system health, container status, DB sizes, and disk usage.
Before running any check, look for this block in TOOLS.md:
text
### tonic-vm-check
- VM_HOST: <host>
- VM_USER: <user>
- SSH_KEY: <path>
If found: extract the values and proceed to Step 2.
If not found: ask the user once:
To check your VM, I need a few details (only asked once — saved to TOOLS.md):
- VM IP or hostname
- SSH username (default: ubuntu)
- Path to SSH private key (default: ~/.ssh/id_rsa)
Then append to TOOLS.md:
markdown
### tonic-vm-check
- VM_HOST: <answer>
- VM_USER: <answer>
- SSH_KEY: <answer>
Confirm saved, then proceed.
bash
VM_HOST=<host> VM_USER=<user> SSH_KEY=<key> bash skills/tonic-vm-check/scripts/vm-check.sh [section]
Sections: all (default) · system · disk · containers · db · docker-df · cleanup
Summarise results:
🖥️ System — Uptime, CPU idle%, load average, memory (total / used / available)
💾 Disk — / usage %, used, free
🐳 Docker — Top containers by MEM USAGE; flag any not healthy or recently restarted
🗄️ DB Sizes — MySQL and Postgres databases auto-detected on the VM
🧹 Cleanup Opportunities — Reclaimable image/cache space; stopped containers worth removing
Always flag items that exceed thresholds:
MetricWarningCriticalDisk usage>70%>85%Memory used>80%>90%Load avg (1m)>2.0>4.0Single container MEM>1 GB>2 GB
docker image prune -af — safe (unused images only)docker builder prune -f — safe (build cache only, no data loss)docker container prune — safe only for stopped containersdocker system prune -af without explicit user approval (destroys volumes)