Table of contents
- Create Health Checks
- Set Alert Thresholds
- Schedule Monitoring
- Monitor Services
- Example Configurations
- Next Steps
- FAQ
Create Health Checks
Create ~/.openclaw/workspace/prompts/server-health.md:
# Server Health Check
Check:
- Disk usage (alert if >85%)
- CPU usage (alert if >80% for 5 min)
- Memory usage (alert if >90%)
- Load average (alert if >2.0)
- Uptime
Report status and any issues found.
Set Alert Thresholds
Create ~/.openclaw/workspace/prompts/server-alerts.md:
# Server Alert Rules
Alert immediately if:
- Disk usage >85%
- Memory usage >90%
- Any critical service is down
- Load average >3.0
Send alerts to Slack and Telegram.
Schedule Monitoring
Add to ~/.openclaw/openclaw.json:
{
"automation": {
"cron": {
"server-health": {
"schedule": "*/5 * * * *",
"prompt": "file:prompts/server-health.md",
"target": "slack"
},
"server-alerts": {
"schedule": "*/2 * * * *",
"prompt": "file:prompts/server-alerts.md",
"target": ["slack", "telegram"]
}
}
}
}
Monitor Services
Create ~/.openclaw/workspace/prompts/service-check.md:
# Service Status Check
Check if these services are running:
- nginx (port 80/443)
- postgresql (port 5432)
- redis (port 6379)
- docker daemon
Restart any failed services and report.
Example Configurations
Disk Usage Alert
df -h | awk '$5+0 > 85 {print $1 " is " $5 " full"}'
CPU Monitoring
top -bn1 | grep "Cpu(s)" | awk '{print $2}' | cut -d'%' -f1
Memory Check
free -m | awk 'NR==2{printf "%.1f%%\n", $3*100/$2}'
Next Steps
FAQ
Q: Can OpenClaw restart services automatically?
A: Yes, but enable approvals for safety. Test in staging first.
Q: How do I monitor multiple servers?
A: Deploy OpenClaw on each server or use SSH to check remote servers.
Q: What about Windows servers?
A: Use PowerShell commands instead of Linux commands.
Q: Can it send alerts via email?
A: Yes. Configure email skills or use the message tool.