suspect80

Bot Status API

运维安全v1.0.1
作者:suspect80更新于 2026-05-17共 2 个版本 · 最新版本发布于 2026-02-05bot-status-api@clawhub_suspect80/bot-status-api
监控告警服务器运维配置生成#Cron#Health

据 AlphaMoat 统计,截至 2026-09,Bot Status API 累计下载 3,388 次、获 0 个星标,在全部 5,078 个 AI 技能中排名第 3,309 位,在「运维安全」分类(264 个)中排名第 212 位。

累计安装
106
累计下载
3,388
星标
-
全站排名
#3,309
全站前 66% · 「运维安全」前 81%
平台累计安装累计下载星标评论
ClawHub ↗1063,388--
SkillHub ↗1063,382-—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

主文描述可配置的 HTTP 服务,提供 bot 状态、服务健康检查、定时任务、skills 清单和系统指标,供监控面板或状态页使用。随附卡片警告,状态输出可能暴露服务、端口、任务时间、邮件元数据及主机信息;服务还可能运行 shell 检查并关闭 TLS 校验。部署前应增加认证、限制到本机或受保护网络,并移除或收窄 TLS 绕过和命令检查。

资料发布于 2026-10-29

可以用来做什么

  • 规划状态 API 的数据范围和监控端点
  • 审查服务、命令和文件检查的配置
  • 评估认证、网络绑定和 TLS 设置

什么时候用

  • 需要为 OpenClaw 运行状态提供受控监控接口时
  • 状态字段和访问范围可先行审查时
  • 可以修复认证、TLS 和命令执行风险后再部署时

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

列出状态接口可能暴露的敏感信息,不要启动服务
将监控端点限制在受保护网络并加入认证
检查命令检查项和 TLS 校验设置后再给部署建议

月度数据趋势

累计下载3,388
1,9222,7103,4972026-03 · 累计下载 2,0312026-05 · 累计下载 2,6402026-06 · 累计下载 2,8092026-07 · 累计下载 3,0962026-08 · 累计下载 3,2492026-09 · 累计下载 3,38826-0326-09
星标-
0112026-03 · 星标 -2026-05 · 星标 -2026-06 · 星标 -2026-07 · 星标 -2026-08 · 星标 -2026-09 · 星标 -26-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-093,388—-
2026-083,249+4.9%-
2026-073,096+10.2%-
2026-062,809+6.4%-
2026-052,640—-
2026-032,031—-

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

3.4 KB · ClawHub v1.0.1
---
name: bot-status-api
description: "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."
---

# Bot Status API

A configurable HTTP service that exposes your OpenClaw bot's operational status as JSON. Designed for dashboard integration, monitoring, and transparency.

## What It Provides
展开全部(共 119 行)

- **Bot Core:** Online status, model, context usage, uptime, heartbeat timing
- **Services:** Health checks for any HTTP endpoint, CLI tool, or file path
- **Email:** Unread counts from any email provider (himalaya, gog, etc.)
- **Cron Jobs:** Reads directly from OpenClaw's `cron/jobs.json`
- **Docker:** Container health via Portainer API
- **Dev Servers:** Auto-detects running dev servers by process grep
- **Skills:** Lists installed and available OpenClaw skills
- **System:** CPU, RAM, Disk metrics from `/proc`

## Setup

### 1. Copy the service files

Copy `server.js`, `collectors/`, and `package.json` to your desired location.

### 2. Create config.json

Copy `config.example.json` to `config.json` and customize:

```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" }
  ]
}
```

### Service Check Types

| Type | Description | Config |
|------|-------------|--------|
| `http` | Fetch URL, check HTTP 200 | `url`, `healthPath`, `method`, `headers`, `body` |
| `command` | Run shell command, check exit 0 | `command`, `timeout` |
| `file-exists` | Check path exists | `path` |

### 3. Run

```bash
node server.js
```

### 4. Persist (systemd user service)

```ini
# ~/.config/systemd/user/bot-status.service
[Unit]
Description=Bot Status API
After=network.target

[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  # survive logout
```

### 5. Context/Vitals from OpenClaw

The bot should periodically write vitals to `heartbeat-state.json` in its workspace:

```json
{
  "vitals": {
    "contextPercent": 62,
    "contextUsed": 124000,
    "contextMax": 200000,
    "model": "claude-opus-4-5",
    "updatedAt": 1770304500000
  }
}
```

Add this to your HEARTBEAT.md so the bot updates it each heartbeat cycle.

## Endpoints

| Endpoint | Description |
|----------|-------------|
| `GET /status` | Full status JSON (cached) |
| `GET /health` | Simple `{"status":"ok"}` |

## Architecture

- **Zero dependencies** — Node.js built-ins only (`http`, `fs`, `child_process`)
- **Non-blocking** — All shell commands use async `exec`, never `execSync`
- **Background refresh** — Cache refreshes on interval, requests always served from cache instantly (~10ms)
- **Config-driven** — Everything in `config.json`, no hardcoded values

「运维安全」分类下的热门技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。