All checks were successful
Reindex Knowledge Base / reindex (push) Successful in 3s
Adds title, description, type, domain, and tags frontmatter to every doc for improved KB semantic search. The description field is prepended to every search chunk, and domain/type/tags enable filtered queries. Type values: context, guide, runbook, reference, troubleshooting Domain values match directory structure (networking, docker, etc.) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4.9 KiB
4.9 KiB
| title | description | type | domain | tags | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Server Diagnostics Skill | Recovered LXC 300 skill reference for automated server troubleshooting. Covers Docker container diagnostics, SSH-based health checks, log reading, metrics collection, remediation workflows, and security constraints. | runbook | monitoring |
|
Server Diagnostics - Automated Troubleshooting
When to Activate This Skill
- N8N triggers with error context
- "diagnose container X", "check docker status"
- "read logs from server", "check disk usage"
- "troubleshoot server issue"
- Any automated health check response
Quick Start
Check All Containers
python ~/.claude/skills/server-diagnostics/client.py docker-status paper-dynasty
Quick Health Check (Docker + System Metrics)
python ~/.claude/skills/server-diagnostics/client.py health paper-dynasty
Get Container Logs
python ~/.claude/skills/server-diagnostics/client.py docker-logs paper-dynasty paper-dynasty_discord-app_1 --lines 200
Restart a Container
python ~/.claude/skills/server-diagnostics/client.py docker-restart paper-dynasty paper-dynasty_discord-app_1
System Metrics
python ~/.claude/skills/server-diagnostics/client.py metrics paper-dynasty --type all
python ~/.claude/skills/server-diagnostics/client.py metrics paper-dynasty --type disk
Run Diagnostic Command
python ~/.claude/skills/server-diagnostics/client.py diagnostic paper-dynasty disk_usage
python ~/.claude/skills/server-diagnostics/client.py diagnostic paper-dynasty memory_usage
Troubleshooting Workflow
When an issue is reported:
-
Quick Health Check - Get overview of containers and system state
python ~/.claude/skills/server-diagnostics/client.py health paper-dynasty -
Check MemoryGraph - Recall similar issues
python ~/.claude/skills/memorygraph/client.py recall "docker container error" -
Get Container Logs - Look for errors
python ~/.claude/skills/server-diagnostics/client.py docker-logs paper-dynasty <container> --lines 500 --filter error -
Remediate if Safe - Restart if allowed
python ~/.claude/skills/server-diagnostics/client.py docker-restart paper-dynasty <container> -
Store Solution - Save to MemoryGraph if resolved
python ~/.claude/skills/memorygraph/client.py store \ --type solution \ --title "Fixed <container> issue" \ --content "Description of problem and solution" \ --tags "docker,paper-dynasty,troubleshooting" \ --importance 0.7
Server Inventory
| Server | IP | SSH User | Description |
|---|---|---|---|
| paper-dynasty | 10.10.0.88 | cal | Paper Dynasty Discord bots and services |
Monitored Containers
| Container | Critical | Restart Allowed | Description |
|---|---|---|---|
| paper-dynasty_discord-app_1 | Yes | Yes | Paper Dynasty Discord bot |
| paper-dynasty_db_1 | Yes | Yes | PostgreSQL database |
| paper-dynasty_adminer_1 | No | Yes | Database admin UI |
| sba-website_sba-web_1 | Yes | Yes | SBA website |
| sba-ghost_sba-ghost_1 | No | Yes | Ghost CMS |
Available Diagnostic Commands
disk_usage- df -hmemory_usage- free -hcpu_usage- top -bn1 | head -20cpu_load- uptimeprocess_list- ps aux --sort=-%mem | head -20network_status- ss -tulndocker_ps- docker ps -a (formatted)docker_stats- docker stats --no-streamjournal_errors- journalctl -p err -n 50
Security Constraints
DENIED Patterns (Will Be Rejected)
- rm -rf, rm -r /
- dd if=, mkfs
- shutdown, reboot
- systemctl stop
- chmod 777
- wget|sh, curl|sh
Container Restart Rules
- Only containers in config.yaml with restart_allowed: true
- N8N container restart is NEVER allowed (it triggers us)
MemoryGraph Integration
Before troubleshooting, check for known solutions:
python ~/.claude/skills/memorygraph/client.py recall "docker paper-dynasty"
After resolving, store the pattern:
python ~/.claude/skills/memorygraph/client.py store \
--type solution \
--title "Brief description" \
--content "Full explanation..." \
--tags "docker,paper-dynasty,fix" \
--importance 0.7
Common Issues and Solutions
Container Not Running
- Check logs for crash reason
- Check disk space and memory
- Attempt restart if allowed
- Escalate if restart fails
High Memory Usage
- Check which container is consuming
- Review docker stats
- Check for memory leaks in logs
- Consider container restart
Disk Space Low
- Run disk_usage diagnostic
- Check docker system df
- Consider log rotation
- Alert user for cleanup
Output Format
All commands return JSON:
{
"success": true,
"stdout": "...",
"stderr": "...",
"returncode": 0,
"data": {...} // Parsed data if applicable
}