← 返回
沟通协作 Key

OpenClaw Watch Dog

Self-healing monitoring system for OpenClaw gateway. Auto-detects failures, fixes crashes, and sends Telegram alerts.
OpenClaw网关自愈监控系统,自动检测故障、修复崩溃并发送Telegram告警。
abdullah4ai
沟通协作 clawhub v1.3.0 1 版本 99461.5 Key: 需要
★ 2
Stars
📥 2,915
下载
💾 129
安装
1
版本
#latest

概述

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.

Prerequisites

  • Telegram Bot Token — Create via @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 on Telegram, then send me the token (looks like 123456:ABC-DEF...)
  1. Your Telegram Chat ID — Send /start to your bot, then visit https://api.telegram.org/bot/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

python3 ~/.openclaw/workspace/openclaw-watchdog/scripts/validate.py "$TELEGRAM_TOKEN"

2. Run setup script

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)

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

# 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

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

版本历史

共 1 个版本

  • v1.3.0 当前
    2026-03-28 14:21 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

communication-collaboration

imap-smtp-email

gzlicanyi
使用IMAP/SMTP读取和发送邮件;检查新/未读邮件、获取内容、搜索邮箱、标记已读/未读、发送带附件的邮件。支持...
★ 113 📥 52,399
data-analysis

McKinsey Research

abdullah4ai
使用12个专业提示进行完整的麦肯锡级市场调研与战略分析。适用场景:市场调研、竞争分析、业务...
★ 12 📥 4,313
communication-collaboration

Slack

steipete
当需要通过 slack 工具从 Clawdbot 控制 Slack 时使用,包括在频道或私信中回复消息或置顶/取消置顶项目。
★ 157 📥 47,675