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
累計下載
3568
星標
2
全站排名
#3,065
全站前 61% · 「運維安全」前 74%
平台累計安裝累計下載星標評論
ClawHub ↗11334922-
SkillHub ↗12935682—

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

這個技能是做什麼的

該技能監控閘道器健康狀態,在檢測到故障時嘗試自動重啟,並向使用者的 Telegram 機器人傳送告警;診斷和日誌分析在本機執行。安裝會建立持續執行的使用者級服務,可能自動重啟閘道器並儲存 Telegram 憑據。僅在確實需要持續監控時啟用,安裝後核對服務狀態與日誌,並只配置必要的機器人憑據。

資料釋出於 2026-10-29

可以用來做什麼

  • 監控 OpenClaw 閘道器健康狀態
  • 在故障時自動重啟併傳送 Telegram 提醒
  • 檢視本地診斷和日誌資訊

什麼時候用

  • 使用者明確要求設定閘道器看護或自動恢復時
  • 已確認希望安裝持續執行的使用者級服務時
  • 能夠安全管理 Telegram 憑據並檢查服務日誌時

示例提示詞

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

先說明 watchdog 會安裝什麼持久服務、需要哪些 Telegram 憑據以及何時會重啟閘道器;等待我確認後再執行安裝。

月度資料趨勢

累計下載3568
2126290136752026-03 · 累計下載 22332026-05 · 累計下載 28762026-06 · 累計下載 30212026-07 · 累計下載 32742026-08 · 累計下載 33922026-09 · 累計下載 356826-0326-09
星標2
1232026-03 · 星標 22026-05 · 星標 22026-06 · 星標 22026-07 · 星標 22026-08 · 星標 22026-09 · 星標 226-0326-09

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

月份累計下載環比星標
2026-093568—2
2026-083392+3.6%2
2026-073274+8.4%2
2026-063021+5.0%2
2026-052876—2
2026-032233—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),按月更新。口徑說明見資料方法。