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
累計下載
3388
星標
-
全站排名
#3,309
全站前 66% · 「運維安全」前 81%
平台累計安裝累計下載星標評論
ClawHub ↗1063388--
SkillHub ↗1063382-—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

主文描述可配置的 HTTP 服務,提供 bot 狀態、服務健康檢查、定時任務、skills 清單和系統指標,供監控面板或狀態頁使用。隨附卡片警告,狀態輸出可能暴露服務、埠、任務時間、郵件後設資料及主機資訊;服務還可能執行 shell 檢查並關閉 TLS 校驗。部署前應增加認證、限制到本機或受保護網路,並移除或收窄 TLS 繞過和命令檢查。

資料釋出於 2026-10-29

可以用來做什麼

  • 規劃狀態 API 的資料範圍和監控端點
  • 審查服務、命令和檔案檢查的配置
  • 評估認證、網路繫結和 TLS 設定

什麼時候用

  • 需要為 OpenClaw 執行狀態提供受控監控介面時
  • 狀態欄位和訪問範圍可先行審查時
  • 可以修復認證、TLS 和命令執行風險後再部署時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

列出狀態介面可能暴露的敏感資訊,不要啟動服務
將監控端點限制在受保護網路並加入認證
檢查命令檢查項和 TLS 校驗設定後再給部署建議

月度資料趨勢

累計下載3388
1922271034972026-03 · 累計下載 20312026-05 · 累計下載 26402026-06 · 累計下載 28092026-07 · 累計下載 30962026-08 · 累計下載 32492026-09 · 累計下載 338826-0326-09
星標-
0112026-03 · 星標 -2026-05 · 星標 -2026-06 · 星標 -2026-07 · 星標 -2026-08 · 星標 -2026-09 · 星標 -26-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-093388—-
2026-083249+4.9%-
2026-073096+10.2%-
2026-062809+6.4%-
2026-052640—-
2026-032031—-

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),按月更新。口徑說明見資料方法。