Install
openclaw skills install server-watchdogMonitor remote servers via SSH — check service health (PM2, systemd, Docker), database status (MongoDB, MySQL, PostgreSQL), disk space, memory, and auto-restart crashed services. Sends alerts via messaging. Use when asked to check server status, monitor services, restart crashed processes, or set up server health checks.
openclaw skills install server-watchdogMonitor and auto-heal remote servers via SSH. Check services, databases, disk, memory — restart what's down, alert what's wrong.
expect available locally (for password-based SSH)ssh user@host "pm2 list"
ssh user@host "pm2 logs --lines 20 --nostream"
# Windows
ssh user@host "net start | findstr MongoDB"
ssh user@host "powershell -Command \"(Test-NetConnection -ComputerName 127.0.0.1 -Port 27017).TcpTestSucceeded\""
# Linux
ssh user@host "systemctl status mongod"
ssh user@host "mongosh --eval 'db.runCommand({ping:1})' --quiet"
# Linux
ssh user@host "df -h && free -h"
# Windows
ssh user@host "powershell -Command \"Get-PSDrive -PSProvider FileSystem | Select Root,Used,Free; \$os=Get-CimInstance Win32_OperatingSystem; Write-Output ('RAM: '+[math]::Round((\$os.TotalVisibleMemorySize-\$os.FreePhysicalMemory)/1MB,1)+'GB / '+[math]::Round(\$os.TotalVisibleMemorySize/1MB,1)+'GB')\""
pm2 restart, net start, systemctl restart)When a service is down, check these in order:
pm2 logs, journalctl -u service, Windows Event Logmongod.log for Fatal ("s":"F") entries"s":"F" — Fatal error (crash)
"Unhandled exception" — Internal bug (often FTDC related)
"Detected unclean shutdown" — Process killed without graceful shutdown
"WiredTiger error" — Storage engine corruption
pm2 restart <service-name>
pm2 save # persist across reboots
net stop MongoDB
timeout /t 5
net start MongoDB
sudo systemctl restart mongod
For persistent monitoring, deploy the included watchdog script:
scripts/mongodb-watchdog.js to target servernpm init -y && npm install mongodbpm2 start mongodb-watchdog.js --name mongodb-watchdogpm2 saveWhen key-based auth isn't available:
expect -c 'set timeout 20
spawn ssh -o StrictHostKeyChecking=no user@host "COMMAND"
expect {
"password:" { send "PASSWORD\r"; exp_continue }
eof
}
'
🚨 Server Alert — [hostname]
⏰ Time: [timestamp]
❌ Issue: [service] is DOWN
📋 Cause: [crash reason from logs]
🔄 Action: Auto-restarted [service]
✅ Status: [service] is back online
📊 System Health:
• Memory: X GB / Y GB
• Disk: Z% used
• Services: N/N online