Get the FREE Ultimate OpenClaw Setup Guide →
r

Port Check

Scanned

@rogue-agent1

npx machina-cli add skill @rogue-agent1/port-check --openclaw
Files (1)
SKILL.md
1.3 KB

Port Check Skill

Quickly verify if services are up and responding on specific ports.

Usage

# Basic TCP check
bash scripts/port-check.sh localhost:8080 localhost:5432

# Multiple targets with HTTP status check
bash scripts/port-check.sh localhost:80 api.example.com:443 --http

# Custom timeout (default 3s)
bash scripts/port-check.sh 192.168.1.1:22 --timeout 5

Output

  • host:port — open (TCP connected)
  • host:port — open (HTTP 200) (with --http flag)
  • ⚠️ host:port — open but HTTP 500 (port open, bad HTTP status)
  • host:port — closed/timeout (no response)

Exit Codes

  • 0 — all targets up
  • 1 — one or more targets down

Common Checks

# OpenClaw gateway
bash scripts/port-check.sh localhost:18789 --http

# Database + web stack
bash scripts/port-check.sh localhost:5432 localhost:6379 localhost:3000

# Home network devices
bash scripts/port-check.sh 192.168.1.1:80 192.168.1.50:22 --timeout 2

Source

git clone https://clawhub.ai/rogue-agent1/port-checkView on GitHub

Overview

Port Check quickly verifies if services respond on specified host:port pairs. It supports TCP connections and HTTP checks with a configurable timeout, making it useful for service monitoring, health checks, and network debugging.

How This Skill Works

The tool runs port-check.sh against one or more host:port targets. Use --http for HTTP status checks and --timeout N to customize the request timeout (default 3s). It reports statuses such as open, open (HTTP 200), open but HTTP 500, or closed/timeout, and returns exit code 0 when all targets are up.

When to Use It

  • Baseline uptime verification for key services
  • After deploying a new port or service
  • Diagnosing firewall or network routing issues
  • Verifying web endpoints respond with HTTP 200
  • On-demand health checks for microservice stacks

Quick Start

  1. Step 1: Run port-check.sh with host:port targets (e.g., bash scripts/port-check.sh localhost:8080)
  2. Step 2: Add --http for HTTP status checks and --timeout N to set the timeout
  3. Step 3: Review the output and rely on exit code 0 (all up) or 1 (any down) for automation

Best Practices

  • Specify a timeout appropriate to your environment (default 3s)
  • Use --http only when you need HTTP status feedback
  • Test related services together to validate end-to-end health
  • Interpret HTTP 500 as port open but service error
  • Use exit codes to drive automation and alerts

Example Use Cases

  • OpenClaw gateway: bash scripts/port-check.sh localhost:18789 --http
  • Database + web stack: bash scripts/port-check.sh localhost:5432 localhost:6379 localhost:3000
  • Home network devices: bash scripts/port-check.sh 192.168.1.1:80 192.168.1.50:22 --timeout 2
  • Basic TCP check: bash scripts/port-check.sh localhost:8080 localhost:5432
  • HTTP checks with status: bash scripts/port-check.sh localhost:80 api.example.com:443 --http

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers