360 Secure SkillHub
360 安全技能中心

Healthprobe

启动本地 FastAPI 服务后,通过一次请求探测目标 URL:返回是否健康(2xx 判定)、HTTP 状态码、响应延迟和错误信息,超时可配置在 100 毫秒到 30 秒之间。

分类:开发
mirni
mirni
热度 23.60
最近更新 2026-05-11 17:42:41

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add mirni/healthprobe
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
healthprobe
description
Probe any URL and check if it's up. Returns the HTTP status code, response latency in milliseconds, and a healthy/not-healthy verdict. Configurable timeout. Useful for checking if an API is available before calling it.
metadata
{"openclaw":{"emoji":"💓","requires":{"bins":["python"]},"install":[{"id":"pip","kind":"uv","packages":["fastapi","uvicorn","pydantic","httpx"]}]}}

HealthProbe

Check if a URL is up before you call it.

Start the server

uvicorn healthprobe.app:app --port 8009

Probe a URL

curl -s -X POST http://localhost:8009/v1/probe \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com"}' | jq

Returns healthy (true if 2xx), status_code (HTTP code or -1 on error), latency_ms, and error (if connection failed).

With custom timeout

curl -s -X POST http://localhost:8009/v1/probe \
  -H "Content-Type: application/json" \
  -d '{"url": "https://slow-api.example.com", "timeout_ms": 1000}' | jq '.healthy'

Timeout range: 100ms to 30,000ms (default: 5,000ms).