port-check

TotalClaw 作者 totalclaw v1.0.0

检查服务是否在给定的主机:端口对上响应。支持具有可配置超时的 TCP 和 HTTP 检查。用于服务监控、健康检查和网络调试。

安装 / 下载方式

TotalClaw CLI推荐
totalclaw install totalclaw:totalclaw~rogue-agent1-port-check
cURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~rogue-agent1-port-check/file -o rogue-agent1-port-check.md
## 概述(中文)

检查服务是否在给定的主机:端口对上响应。支持具有可配置超时的 TCP 和 HTTP 检查。用于服务监控、健康检查和网络调试。

## 原文

# Port Check Skill

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

## Usage

```bash
# 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
```bash
# 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
```