360 Secure SkillHub
360 安全技能中心

Healthprobe

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

mirni
mirni
热度 36.33
最近更新 2026-05-11 17:42:41
分类:开发依赖:代码执行 / 第三方 API应用场景:API 集成 / DevOps

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add 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).