Abdullah AlRashoudi

OpenClaw Watch Dog

运维安全v1.3.0
作者:Abdullah AlRashoudi更新于 2026-05-17共 14 个版本 · 最新版本发布于 2026-02-19openclaw-watchdog@clawhub_abdullah4ai/openclaw-watchdog
监控告警服务器运维故障排查#Telegram

据 AlphaMoat 统计,截至 2026-09,OpenClaw Watch Dog 累计下载 3,568 次、获 2 个星标,在全部 5,078 个 AI 技能中排名第 3,065 位,在「运维安全」分类(264 个)中排名第 194 位。

累计安装
129
累计下载
3,568
星标
2
全站排名
#3,065
全站前 61% · 「运维安全」前 74%
平台累计安装累计下载星标评论
ClawHub ↗1133,4922-
SkillHub ↗1293,5682—

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

这个技能是做什么的

该技能监控网关健康状态,在检测到故障时尝试自动重启,并向用户的 Telegram 机器人发送告警;诊断和日志分析在本机执行。安装会创建持续运行的用户级服务,可能自动重启网关并保存 Telegram 凭据。仅在确实需要持续监控时启用,安装后核对服务状态与日志,并只配置必要的机器人凭据。

资料发布于 2026-10-29

可以用来做什么

  • 监控 OpenClaw 网关健康状态
  • 在故障时自动重启并发送 Telegram 提醒
  • 查看本地诊断和日志信息

什么时候用

  • 用户明确要求设置网关看护或自动恢复时
  • 已确认希望安装持续运行的用户级服务时
  • 能够安全管理 Telegram 凭据并检查服务日志时

示例提示词

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

先说明 watchdog 会安装什么持久服务、需要哪些 Telegram 凭据以及何时会重启网关;等待我确认后再执行安装。

月度数据趋势

累计下载3,568
2,1262,9013,6752026-03 · 累计下载 2,2332026-05 · 累计下载 2,8762026-06 · 累计下载 3,0212026-07 · 累计下载 3,2742026-08 · 累计下载 3,3922026-09 · 累计下载 3,56826-0326-09
星标2
1232026-03 · 星标 22026-05 · 星标 22026-06 · 星标 22026-07 · 星标 22026-08 · 星标 22026-09 · 星标 226-0326-09

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

月份累计下载环比星标
2026-093,568—2
2026-083,392+3.6%2
2026-073,274+8.4%2
2026-063,021+5.0%2
2026-052,876—2
2026-032,233—2

SKILL.md 原文

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

4.1 KB · ClawHub v1.3.0
---
name: openclaw-watchdog
description: Self-healing monitoring system for OpenClaw gateway. Auto-detects failures, fixes crashes, and sends Telegram alerts.
homepage: https://github.com/Abdullah4AI/openclaw-watchdog
metadata: {"openclaw":{"emoji":"🐕","disableModelInvocation":true,"requires":{"bins":["python3","openssl"],"env":["TELEGRAM_TOKEN","TELEGRAM_CHAT_ID"]},"install":[{"id":"setup","kind":"script","script":"scripts/setup.sh","label":"Install watchdog service (LaunchAgent/systemd user)","persistence":"user-level","service":true}]}}
---

# openclaw-watchdog

**Description:** Self-healing monitoring system for OpenClaw gateway. Monitors health, auto-restarts on failure, and sends Telegram alerts. Diagnostics and log analysis run locally on-device. Alert notifications are sent to the user's Telegram bot. Use when user wants to set up gateway monitoring, watchdog, or auto-recovery.
展开全部(共 104 行)

## Prerequisites
- **Telegram Bot Token** — Create via [@BotFather](https://t.me/BotFather)
- **Telegram Chat ID** — Your personal chat ID for receiving alerts
- **Python 3** — Required for the watchdog service
- **OpenClaw** — Installed and running

## Trigger Keywords
- watchdog, monitoring, auto-fix, gateway health, self-healing, auto-recovery, watch dog

## Setup

Send the user ONE message with everything they need:

---

🐕 **Watch Dog — Self-Healing Gateway Monitor**

Watch Dog is a background service that pings your OpenClaw gateway every 15 seconds. If the gateway goes down, it automatically attempts to restart it and sends you Telegram alerts so you're always in the loop. All diagnostics run locally on your device.

To set it up, I need:

1. **Telegram Bot Token** — Create a bot via [@BotFather](https://t.me/BotFather) on Telegram, then send me the token (looks like `123456:ABC-DEF...`)

2. **Your Telegram Chat ID** — Send `/start` to your bot, then visit `https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates` to find your chat ID

Send me the token and chat ID and I'll handle the rest (including a test run to make sure everything works)!

---

## After Receiving Credentials

Run these steps in order:

### 1. Validate credentials
```bash
python3 ~/.openclaw/workspace/openclaw-watchdog/scripts/validate.py "$TELEGRAM_TOKEN"
```

### 2. Run setup script
```bash
chmod +x ~/.openclaw/workspace/openclaw-watchdog/scripts/setup.sh
~/.openclaw/workspace/openclaw-watchdog/scripts/setup.sh \
  --telegram-token "$TELEGRAM_TOKEN" \
  --telegram-chat-id "$TELEGRAM_CHAT_ID" \
  --gateway-port "$GATEWAY_PORT"  # optional, auto-detected from openclaw.json
```

### 3. Connect via Telegram (Pairing)
```bash
python3 ~/.openclaw/workspace/openclaw-watchdog/scripts/test-message.py "$TELEGRAM_TOKEN" "$TELEGRAM_CHAT_ID"
```
Wait for user to confirm they received the Telegram message before proceeding.

### 4. Verify it's running
```bash
# Check service status
if [[ "$(uname)" == "Darwin" ]]; then
  launchctl list | grep openclaw.watchdog
else
  systemctl --user status openclaw-watchdog
fi

# Check logs
tail -20 ~/.openclaw/watchdog/watchdog.log
```

### 5. Confirm to user
Tell them Watch Dog is active, what it monitors, and that they'll get Telegram alerts if anything goes wrong.

## How It Works

- Pings gateway health endpoint every 15 seconds (auto-detects port from config, or set via `--gateway-port`)
- After 3 consecutive failures, attempts `openclaw gateway restart`
- Up to 2 restart attempts, then asks user for reinstall permission via Telegram
- User approves by running: `touch ~/.openclaw/watchdog/approve-reinstall`
- Without approval, only sends notifications — no destructive actions
- Local pattern-matching diagnostics (no logs sent externally)
- Runs as macOS LaunchAgent or Linux systemd user service
- Credentials encrypted with AES-256 using machine-specific key

## Uninstall
```bash
if [[ "$(uname)" == "Darwin" ]]; then
  launchctl unload ~/Library/LaunchAgents/com.openclaw.watchdog.plist 2>/dev/null
  rm -f ~/Library/LaunchAgents/com.openclaw.watchdog.plist
else
  systemctl --user stop openclaw-watchdog 2>/dev/null
  systemctl --user disable openclaw-watchdog 2>/dev/null
  rm -f ~/.config/systemd/user/openclaw-watchdog.service
fi
rm -rf ~/.openclaw/watchdog
```

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

Abdullah AlRashoudi 的其他技能

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