claude-memory/graph/solutions/n8n-claude-code-automated-server-monitoring-system-62ee21.md
2026-02-28 07:29:56 -06:00

1.9 KiB

id type title tags importance confidence created updated relations
62ee21e8-2b56-4d38-a73d-47e2724f08c6 solution N8N + Claude Code Automated Server Monitoring System
n8n
claude-code
automation
docker
monitoring
homelab
discord
ssh
proxmox
0.9 0.8 2025-12-20T04:35:53.428069+00:00 2026-02-28T13:29:56.760688+00:00
target type direction strength
775506ce-ed06-4c36-95f3-73379855b44a BUILDS_ON outgoing 0.5
target type direction strength edge_id
7fdc5ceb-4b8c-426d-8492-948d106f92bb BUILDS_ON incoming 0.9 4fe26e78-998a-4524-8323-63b82348c1ca
target type direction strength edge_id
aab3d007-0cdf-4a4f-9b55-096ea4bdc168 BUILDS_ON incoming 0.8 dde412b4-e0ee-4781-b1af-07cb3290d740

Built automated server health monitoring with N8N and Claude Code headless mode.

Architecture:

  • Claude Code LXC (10.10.0.148, CT 300) runs diagnostics
  • N8N (10.10.0.210) triggers checks every 5 minutes
  • Two-stage cost optimization: free Python health check, Claude only on issues
  • SSH chain: N8N → Claude LXC → Target servers

Key Components:

  • server-diagnostics skill at ~/.claude/skills/server-diagnostics/
  • health-check.sh: Free detection script (grep for exited/stopped containers)
  • remediate.sh: Claude-powered analysis and auto-fix
  • Discord webhook for alerts

Lessons Learned:

  • Docker 20.10 doesn't support --format 'json', use Go templates instead
  • N8N SSH node has quoting issues - use wrapper scripts
  • Discord embeds don't support markdown tables - use bullet points
  • Ubuntu 22.04 LXC template failed, 20.04 works
  • Python 3.8 needs Optional[str] not str | None syntax

Cost Model:

  • Healthy checks: $0 (just Python script)
  • Issues found: ~$0.10-0.15 (Claude remediation)

Bonus Fixes:

  • avahi-daemon was consuming 67+ hours CPU responding to Docker veth changes
  • GNOME desktop services (gdm, gvfs) wasting ~12% CPU on headless server