Original planning folder (no git repo) for the server diagnostics system that runs on CT 300. Live deployment is on claude-runner; this preserves the Agent SDK reference, PRD with Phase 2/3 roadmap, and N8N workflow designs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3.9 KiB
3.9 KiB
N8N Setup Instructions
This guide walks through configuring the N8N health check workflow.
Prerequisites
- N8N running at http://10.10.0.210:5678
- SSH access configured between N8N LXC and Claude Code LXC (already done)
- Discord webhook configured (already done)
Step 1: Create SSH Credential in N8N
- Open N8N at http://10.10.0.210:5678
- Go to Settings (gear icon) → Credentials
- Click Add Credential
- Search for and select SSH
- Configure:
- Credential Name:
Claude Code LXC - Host:
10.10.0.148 - Port:
22 - Username:
root - Authentication:
Private Key - Private Key: Paste the following:
- Credential Name:
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
QyNTUxOQAAACAtHWX+TOsNkiL7TP1niwpO5AJjBThghODpa1q93g7bagAAAJiq1/Cyqtfw
sgAAAAtzc2gtZWQyNTUxOQAAACAtHWX+TOsNkiL7TP1niwpO5AJjBThghODpa1q93g7bag
AAAEBVXct4LSCsRexl9JYZtrYx4YVoioYBdWHlPinW+PudBS0dZf5M6w2SIvtM/WeLCk7k
AmMFOGCE4OlrWr3eDttqAAAAEm44bi10by1jbGF1ZGUtY29kZQECAw==
-----END OPENSSH PRIVATE KEY-----
- Click Save
Step 2: Import the Workflow
- Go to Workflows in N8N
- Click Add Workflow → Import from File
- Select:
/mnt/NV2/Development/headless-claude/n8n-workflow-import.json- Or copy the workflow from this repo
- After import, open the workflow
Step 3: Link the SSH Credential
- Click on the Run Claude Diagnostics node
- In the Credential dropdown, select
Claude Code LXC - Click Save
Step 4: Test the Workflow
-
Click Execute Workflow (play button)
-
Watch each node execute:
- Every 5 Minutes → triggers
- Run Claude Diagnostics → SSHs to Claude Code LXC
- Parse Claude Response → extracts result
- Has Issues? → routes based on health
- Discord Alert or Discord OK → sends notification
-
Check Discord for the notification
Step 5: Activate the Workflow
- Toggle the workflow to Active (top right)
- The workflow will now run every 5 minutes automatically
Workflow Behavior
Schedule
- Runs every 5 minutes by default
- Adjust in "Every 5 Minutes" node settings
Health Check
- Calls Claude Code headless mode
- Runs
python3 ~/.claude/skills/server-diagnostics/client.py health paper-dynasty - Claude analyzes results and summarizes
Notifications
- Issues Found: Red Discord embed with alert details
- All Healthy: Green Discord embed (disabled by default - enable "Discord OK" node if wanted)
Cost
- Each health check costs ~$0.08 (Claude API usage)
- At 5-minute intervals: ~$0.08 × 12 × 24 = ~$23/day
- Consider increasing interval to 15-30 minutes for cost savings
Customization
Change Check Interval
- Open "Every 5 Minutes" node
- Adjust
minutesIntervalvalue
Add More Servers
- Update config.yaml on Claude Code LXC
- Modify the Claude prompt in "Run Claude Diagnostics" node
Enable OK Notifications
- Click "Discord OK (Optional)" node
- Toggle off "Disabled" setting
Troubleshooting
SSH Connection Failed
# Test from N8N LXC
ssh -i ~/.ssh/n8n_to_claude root@10.10.0.148 "hostname"
Claude Command Not Found
# Verify Claude path on Claude Code LXC
/root/.local/bin/claude --version
Authentication Expired
If Claude returns auth errors, SSH to Claude Code LXC and re-authenticate:
ssh root@10.10.0.148
/root/.local/bin/claude # Follow device code flow
Architecture
N8N (10.10.0.210)
│
├── Schedule Trigger (every 5 min)
│
└── SSH to Claude Code LXC (10.10.0.148)
│
└── Claude Code Headless Mode
│
└── server-diagnostics skill
│
└── SSH to Paper Dynasty (10.10.0.88)
│
└── Docker health checks