Deploy a lightweight status API that exposes your OpenClaw bot's runtime health, service connectivity, cron jobs, skills, system metrics, and more. Use when setting up a monitoring dashboard, health endpoint, or status page for an OpenClaw agent. Supports any services via config (HTTP checks, CLI commands, file checks). Zero dependencies — Node.js only.
一个可配置的 HTTP 服务,以 JSON 格式暴露你的 OpenClaw 机器人的运行状态。专为仪表盘集成、监控和透明度而设计。
将 server.js、collectors/ 和 package.json 复制到你想要的位置。
将 config.example.json 复制为 config.json 并进行自定义:
json
{
port: 3200,
name: MyBot,
workspace: /path/to/.openclaw/workspace,
openclawHome: /path/to/.openclaw,
cache: { ttlMs: 10000 },
model: claude-sonnet-4-20250514,
skillDirs: [/path/to/openclaw/skills],
services: [
{ name: myservice, type: http, url: http://..., healthPath: /health }
]
}
| 类型 | 描述 | 配置 |
|---|---|---|
| http | 获取 URL,检查 HTTP 200 | url、healthPath、method、headers、body |
| command |
bash
node server.js
ini
[Service]
Type=simple
WorkingDirectory=/path/to/bot-status
ExecStart=/usr/bin/node server.js
Restart=always
RestartSec=5
Environment=PORT=3200
Environment=HOME=/home/youruser
Environment=PATH=/usr/local/bin:/usr/bin:/bin
[Install]
WantedBy=default.target
bash
systemctl --user daemon-reload
systemctl --user enable --now bot-status
loginctl enable-linger $USER # 退出登录后保持运行
机器人应定期将运行状态写入其工作空间中的 heartbeat-state.json:
json
{
vitals: {
contextPercent: 62,
contextUsed: 124000,
contextMax: 200000,
model: claude-opus-4-5,
updatedAt: 1770304500000
}
}
将此添加到你的 HEARTBEAT.md 中,以便机器人在每个心跳周期更新它。
| 端点 | 描述 |
|---|---|
| GET /status | 完整状态 JSON(已缓存) |
| GET /health |
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 bot-status-api-1776358525 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 bot-status-api-1776358525 技能
skillhub install bot-status-api-1776358525
文件大小: 13.64 KB | 发布时间: 2026-4-17 15:25