Network Connectivity Check
Diagnose network connectivity to hosts or IPs. Validates deploy_to_ephemeral and security_audit.
Inputs
| Input |
Type |
Default |
Purpose |
targets |
string |
required |
Comma-separated hosts or IPs |
check_vpn |
bool |
true |
Check VPN for internal targets |
full_scan |
bool |
false |
Run full port scan (slower) |
Workflow
1. Load Persona
2. Check Known Issues
check_known_issues("nmap", "")
check_known_issues("network", "")
check_known_issues("vpn", "")
3. System Identity
hostnamectl_status() — local system identity
4. Ping / Discovery
nmap_ping_scan(target="{{ first_target }}") — host reachability
nmap_list_scan(target="{{ first_target }}") — DNS resolution
nmap_quick_scan(target="{{ first_target }}") — port scan
5. HTTP Checks
curl_get(url="https://{{ first_target }}")
curl_timing(url="https://{{ first_target }}")
curl_headers(url="https://{{ first_target }}")
6. SSH Check
ssh_test(host="{{ first_target }}")
ssh_keyscan(host="{{ first_target }}")
7. TLS Check
openssl_s_client(host="{{ first_target }}")
8. Analyze Results
- Ping: "host is up" or "1 host up" → reachable
- HTTP: status 200–499 → ok
- SSH: "connected" → available
- TLS: "verify return code: 0" → secure
- Latency: parse
total from curl_timing
9. Failure Learning
- "no route to host" →
learn_tool_fix("nmap_ping_scan", "no route to host", "Target unreachable - VPN may be required", "Run vpn_connect()")
- "could not resolve" →
learn_tool_fix("curl_get", "could not resolve", "DNS resolution failed", "Check DNS and hostname")
10. Memory
memory_session_log("Network connectivity check on {{ targets }}", "passed=X/Y, latency=Zs")
Error Recovery
| Error |
Action |
| "no route to host" |
vpn_connect() |
| "could not resolve" |
Verify hostname, check DNS |
| Unauthorized |
Check VPN for internal targets |
Output
Report: connectivity summary (ping, http, ssh, tls), latency, host discovery, port scan, SSH keyscan, known issues.
Chains To
security_audit, cert_check, create_jira_issue, investigate_alert
1---2name: network-connectivity-check3description: Diagnose network connectivity issues to one or more targets. Performs ping sweep, port scan, HTTP/TLS/SSH checks. Use when checking reachability, debugging "no route to host", or verifying VPN connectivity.4---56# Network Connectivity Check78Diagnose network connectivity to hosts or IPs. Validates deploy_to_ephemeral and security_audit.910## Inputs1112| Input | Type | Default | Purpose |13|-------|------|---------|---------|14| `targets` | string | required | Comma-separated hosts or IPs |15| `check_vpn` | bool | true | Check VPN for internal targets |16| `full_scan` | bool | false | Run full port scan (slower) |1718## Workflow1920### 1. Load Persona21- `persona_load("devops")`2223### 2. Check Known Issues24- `check_known_issues("nmap", "")`25- `check_known_issues("network", "")`26- `check_known_issues("vpn", "")`2728### 3. System Identity29- `hostnamectl_status()` — local system identity3031### 4. Ping / Discovery32- `nmap_ping_scan(target="{{ first_target }}")` — host reachability33- `nmap_list_scan(target="{{ first_target }}")` — DNS resolution34- `nmap_quick_scan(target="{{ first_target }}")` — port scan3536### 5. HTTP Checks37- `curl_get(url="https://{{ first_target }}")`38- `curl_timing(url="https://{{ first_target }}")`39- `curl_headers(url="https://{{ first_target }}")`4041### 6. SSH Check42- `ssh_test(host="{{ first_target }}")`43- `ssh_keyscan(host="{{ first_target }}")`4445### 7. TLS Check46- `openssl_s_client(host="{{ first_target }}")`4748### 8. Analyze Results49- Ping: "host is up" or "1 host up" → reachable50- HTTP: status 200–499 → ok51- SSH: "connected" → available52- TLS: "verify return code: 0" → secure53- Latency: parse `total` from curl_timing5455### 9. Failure Learning56- "no route to host" → `learn_tool_fix("nmap_ping_scan", "no route to host", "Target unreachable - VPN may be required", "Run vpn_connect()")`57- "could not resolve" → `learn_tool_fix("curl_get", "could not resolve", "DNS resolution failed", "Check DNS and hostname")`5859### 10. Memory60- `memory_session_log("Network connectivity check on {{ targets }}", "passed=X/Y, latency=Zs")`6162## Error Recovery6364| Error | Action |65|-------|--------|66| "no route to host" | `vpn_connect()` |67| "could not resolve" | Verify hostname, check DNS |68| Unauthorized | Check VPN for internal targets |6970## Output7172Report: connectivity summary (ping, http, ssh, tls), latency, host discovery, port scan, SSH keyscan, known issues.7374## Chains To7576- `security_audit`, `cert_check`, `create_jira_issue`, `investigate_alert`