| name | system-diagnostics |
| description | Comprehensive system diagnostics for OpenClaw. Provides one-command full system check, log aggregation, configuration validation, dependency verification, and health score calculation. Use when troubleshooting system-wide issues, performing health audits, or validating system integrity after deployments. |
System Diagnostics
When to use this skill
Use this skill when you need to:
- Perform a comprehensive one-command system health check
- Aggregate and analyze logs from all components
- Validate OpenClaw configuration files
- Verify system dependencies (Docker, Node.js, services)
- Calculate an overall system health score
- Troubleshoot multi-component failures
- Pre-deployment validation
- Post-incident system audit
When NOT to use this skill
Do NOT use this skill when:
- You need to analyze specific log patterns in detail (use
log-analyzer skill)
- You need to inspect agent memory state (use
state-inspector skill)
- You need to recover from corruption (use
corruption-recovery skill)
- You need to manage agent lifecycle (use
agent-lifecycle-manager skill)
- You need to monitor gateway/LiteLLM continuously (use
gateway-pulse skill)
Inputs required
Before executing, determine:
- Scope: full system, specific component, or targeted check
- Output format: console, JSON, or report file
- Verbose mode: whether to include detailed output
- Auto-fix: whether to attempt automatic remediation
Workflow
1. Run full system diagnostics
./scripts/diagnostics.sh full
./scripts/diagnostics.sh full --verbose
./scripts/diagnostics.sh full --json
2. Component-specific checks
./scripts/diagnostics.sh component --name gateway
./scripts/diagnostics.sh component --name litellm
./scripts/diagnostics.sh component --name database
./scripts/diagnostics.sh component --name agents
3. Configuration validation
./scripts/diagnostics.sh config --file openclaw.json
./scripts/diagnostics.sh config --all
./scripts/diagnostics.sh config --all --auto-fix
4. Dependency verification
./scripts/diagnostics.sh deps --system
./scripts/diagnostics.sh deps --docker
./scripts/diagnostics.sh deps --node
./scripts/diagnostics.sh deps --all
5. Log aggregation
./scripts/diagnostics.sh logs --aggregate
./scripts/diagnostics.sh logs --aggregate --filter errors
./scripts/diagnostics.sh logs --aggregate --since "1h ago"
6. Health score
./scripts/diagnostics.sh health-score
./scripts/diagnostics.sh health-score --breakdown
./scripts/diagnostics.sh health-score --history
Health Score Calculation
The health score (0-100) is calculated based on:
| Component | Weight | Criteria |
|---|
| Gateway | 25% | WebSocket connectivity, response time |
| LiteLLM | 25% | API availability, model access |
| Database | 20% | Connection, query response |
| Agents | 20% | Running count, health endpoints |
| System | 10% | CPU, memory, disk |
Score interpretation:
- 90-100: Excellent
- 75-89: Good
- 50-74: Degraded
- 25-49: Critical
- 0-24: Failed
Files
Examples
Example 1: Quick health check
./scripts/diagnostics.sh health-score
Example 2: Pre-deployment validation
./scripts/diagnostics.sh full --verbose --output report.json
Example 3: Troubleshoot failure
./scripts/diagnostics.sh full --auto-fix
Troubleshooting
Diagnostics fail to run
- Verify Node.js version:
node --version (requires >= 18.0.0)
- Check script permissions:
chmod +x scripts/diagnostics.sh
- Verify dependencies:
./scripts/diagnostics.sh deps --node
Health score is low
- Run with breakdown:
./scripts/diagnostics.sh health-score --breakdown
- Check component status:
./scripts/diagnostics.sh component --name <component>
- Review aggregated logs:
./scripts/diagnostics.sh logs --aggregate --filter errors
Configuration validation fails
- View specific errors:
./scripts/diagnostics.sh config --all --verbose
- Attempt auto-fix:
./scripts/diagnostics.sh config --all --auto-fix
- Manual review: Compare with
heretek-openclaw-core/openclaw.json
Gateway Integration
This skill integrates with the OpenClaw Gateway WebSocket RPC on port 18789:
- Gateway health check uses
/health endpoint
- Agent status retrieved via Gateway WebSocket
- Diagnostics results published to Gateway for dashboard display
LiteLLM Integration
LiteLLM health checks verify:
/health endpoint on port 4000
- Model availability via
/v1/models
- Chat completion functionality
- Token usage tracking
Common Debugging Scenarios
Agent offline detection and recovery
./scripts/diagnostics.sh component --name agents --filter offline
./scripts/diagnostics.sh component --name agents --auto-recover
LiteLLM gateway failure
./scripts/diagnostics.sh component --name litellm --verbose
./scripts/diagnostics.sh deps --network --target litellm:4000
Triad deliberation deadlock
./scripts/diagnostics.sh component --name triad
./scripts/diagnostics.sh logs --component triad --aggregate
Database corruption
./scripts/diagnostics.sh component --name database --integrity