Testing nodes

From Buywatermelon/tunpilot · View interactive version

Testing nodes is an AI agent skill from the GitHub repository Buywatermelon/tunpilot. Runs IP reputation checks (risk scores, streaming unlock, blacklists via 9 providers) and network performance tests (BGP, latency, speed, routing to 31 Chinese provinces) on proxy nodes via SSH. Generates structured health reports with actionable recommendations. Use when testing proxy node quality,

How to use this skill

Skill file

TunPilot Node Diagnostics

Dual-dimension diagnostics via direct SSH: IPQuality for IP reputation (risk scores, streaming unlock, blacklists) and NetQuality for network performance (BGP, latency, speed, routing). Zero API keys required.

Prerequisites:

Auxiliary files (read when referenced below):


Phase 1: Identify Target

Ask the user which node(s) to test. Use list_nodes to show available nodes if needed.

Accept:


Phase 2: Run Diagnostics

For each target node, fetch ssh_alias, ssh_user, host, ssh_port via list_nodes.

Resolve SSH target (used as <ssh_target> below):

2.0 Pre-flight Check

ssh <ssh_target> "tunpilot-diag --version"

If missing, read ../_shared/DIAG_SETUP.md and run both steps on this node.

2.1 Execute Diagnostics

tunpilot-diag subcommands:

Full suite:

ssh <ssh_target> "tunpilot-diag"

Output is two JSON lines on stdout:

If a check fails the line contains "error" instead of "data".

Execution Strategy

Fallback (if `tunpilot-diag` cannot be installed)

Run the raw scripts with ANSI filtering and extract JSON:

ssh <ssh_target> "export TERM=dumb; bash <(curl -sL IP.Check.Place) -j -4" 2>&1 \
  | sed 's/\x1b\[[0-9;]*m//g' > /tmp/ipquality-<node>.txt
python3 -c "
import json, sys
content = open('/tmp/ipquality-<node>.txt').read()
depth, start = 0, -1
for i, c in enumerate(content):
    if c == '{' and start == -1: start, depth = i, 1
    elif start >= 0:
        depth += (c == '{') - (c == '}')
        if depth == 0:
            data = json.loads(content[start:i+1])
            if 'Head' in data or 'Info' in data:
                print(json.dumps(data)); break
            start = -1
"

Repeat for NetQuality with Net.Check.Place and -j -4 -y flags.


Phase 3: Present Report

Read REPORT_TEMPLATE.md for the full table layout. Use REFERENCE.md for score ratings, classification consensus analysis, and pattern matching.


Phase 4: Analysis & Recommendations

Analyse each node using the IP Quality Patterns and Network Quality Patterns in REFERENCE.md. Provide specific, actionable recommendations referencing actual data from the report — avoid generic advice.

For multi-node comparisons, follow the Multi-Node Recommendation guidelines in REFERENCE.md.


Troubleshooting

| Symptom | Cause | Fix |

|---------|-------|-----|

| "Invalid input, script exited" | IPQuality dependencies missing | apt-get install -y -qq jq curl bc netcat-openbsd dnsutils iproute2 |

| "No JSON found in output" | Script produced no JSON (captive portal, ANSI leak, etc.) | Run raw: ssh <ssh_target> "bash <(curl -sL IP.Check.Place) -j -4" |

| IPQS: null in scores | IPQS API unreachable | Not a problem — other 5 providers still give useful data |

| NetQuality timeout (>10 min) | Full mode too slow for this server | tunpilot-diag ip for quick IP-only check, or tunpilot-diag net without speedtest |

| iperf3 not installed | Missing dependency | apt-get install -y -qq iperf3 mtr |

| "speedtest not found" persists | -y auto-install failed | curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.deb.sh \| bash && apt-get install -y speedtest |

For generic SSH / systemd failures, see ../_shared/SSH_TROUBLESHOOTING.md.


CLI Reference

| Command | Use When |

|---------|----------|

| tunpilot node list | See registered nodes with ssh_alias/ssh_user config |

| tunpilot health [<id>] | Quick health check before running diagnostics |

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.