360 Secure SkillHub
360 安全技能中心

Healthprobe

核心功能:探测指定URL健康状态,返回健康判定(2xx为健康)、HTTP状态码、响应延迟,支持100-30000ms自定义超时(默认5000ms)。典型场景:调用API前预检查可用性。需先启动服务,通过POST请求提交含url及可选timeout_ms的JSON输入,返回含相关结果的JSON输出。

mirni
mirni
热度 36.31
最近更新 2026-05-11 17:42:41
分类:自动化依赖:代码执行 / 第三方 API应用场景:自动化脚本

安装技能

复制下面的话术发给你的 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).