---
name: multi-vps
description: Orchestrate commands and monitoring across multiple VPS servers (60, 137, 227). Unified health checks, coordinated deployments, and centralized management.
---

# Multi-VPS Orchestration Skill

Manage all VPS servers from a single interface with coordinated operations.

## VPS Inventory

| VPS | ZeroTier IP | Public IP | Purpose | SSH |
|-----|-------------|-----------|---------|-----|
| 60 | 10.180.160.60 | - | Main apps (Rima, JagaVPN, Infisical) | port 6746 |
| 137 | 10.180.160.137 | - | Clawdbot, services | port 6746 |
| 227 | 10.180.160.227 | 168.110.204.71 | MikroTik bots, VPN server | port 6746 |

SSH Access: `sshpass -p '090994' ssh -p 6746 zesbe@10.180.160.X`

## Unified Commands

### Health Check All
```bash
for vps in 60 137 227; do
  echo "=== VPS $vps ==="
  sshpass -p '090994' ssh -p 6746 zesbe@10.180.160.$vps \
    "uptime && df -h / && docker ps --format '{{.Names}}: {{.Status}}'"
done
```

### Parallel Execution
```bash
# Run command on all VPS simultaneously
parallel_exec() {
  for vps in 60 137 227; do
    sshpass -p '090994' ssh -p 6746 zesbe@10.180.160.$vps "$1" &
  done
  wait
}
```

## Health Report Template

```
📊 MULTI-VPS HEALTH REPORT
Generated: 2026-01-29 19:30 UTC

┌─────────────────────────────────────────────┐
│ VPS 60 (Main Apps)                          │
├─────────────────────────────────────────────┤
│ Status: ✅ Online                            │
│ Uptime: 7 weeks, 3 days                     │
│ Disk: 31% (134GB free)                      │
│ Memory: 43%                                 │
│ Containers: 13 running                      │
│ Services: rima ✅, jagavpn ✅, infisical ✅  │
└─────────────────────────────────────────────┘

┌─────────────────────────────────────────────┐
│ VPS 137 (Clawdbot)                          │
├─────────────────────────────────────────────┤
│ Status: ✅ Online                            │
│ Uptime: X days                              │
│ Disk: XX%                                   │
│ Memory: XX%                                 │
│ Services: clawdbot ✅                        │
└─────────────────────────────────────────────┘

┌─────────────────────────────────────────────┐
│ VPS 227 (MikroTik/VPN)                      │
├─────────────────────────────────────────────┤
│ Status: ✅ Online                            │
│ Uptime: X days                              │
│ Disk: XX%                                   │
│ Memory: XX%                                 │
│ Services: mikrotik-bot ✅, vpn-bot ✅        │
└─────────────────────────────────────────────┘

Summary: 3/3 VPS healthy, 0 warnings, 0 critical
```

## Coordinated Operations

### Sync Configs
```bash
# Sync CLAUDE.md to all VPS
for vps in 60 137 227; do
  scp -P 6746 ~/.claude/CLAUDE.md zesbe@10.180.160.$vps:~/.claude/
done
```

### Rolling Updates
```bash
# Update one VPS at a time with health verification
for vps in 60 137 227; do
  echo "Updating VPS $vps..."
  ssh_exec $vps "cd ~/project && git pull && docker compose up -d --build"
  sleep 30  # Wait for stabilization
  if ! health_check $vps; then
    echo "❌ VPS $vps failed, rolling back"
    ssh_exec $vps "docker compose down && git checkout HEAD~1 && docker compose up -d"
    exit 1
  fi
  echo "✅ VPS $vps updated successfully"
done
```

### Centralized Cleanup
```bash
# Cleanup all VPS
for vps in 60 137 227; do
  echo "Cleaning VPS $vps..."
  ssh_exec $vps "docker system prune -af && docker builder prune -af"
done
```

## Service Discovery

Auto-detect services on each VPS:
```bash
ssh_exec $vps "docker ps --format '{{.Names}}' | sort"
```

## Alerting

When ANY VPS has issues:
1. Identify affected VPS
2. Check if issue is isolated or systemic
3. Alert with VPS-specific context
4. Suggest cross-VPS implications

## Best Practices

- Always check VPS connectivity before operations
- Use parallel execution for read operations
- Use sequential execution for write operations
- Verify health after any change
- Keep VPS configs in sync where applicable
