← 返回
沟通协作 Key 中文

Gateway Watchdog Discord

Monitor OpenClaw gateway health with a watchdog state machine, Discord alerts, cooldown dedupe, and isolated fallback deployment on macOS. Use when users wan...
使用看门狗状态机监控 OpenClaw 网关健康状况,配合 Discord 报警、去重冷却机制以及 macOS 上的隔离回退部署。在用户需要...时使用。
jonathanjing
沟通协作 clawhub v1.0.2 2 版本 99903.9 Key: 需要
★ 0
Stars
📥 1,040
下载
💾 16
安装
2
版本
#latest

概述

Gateway Watchdog (Discord)

Discord-first watchdog for OpenClaw gateway incidents.

🛠️ Installation

1. Ask OpenClaw (Recommended)

Tell OpenClaw: "Install the gateway-watchdog skill." The agent will handle the installation and configuration automatically.

2. Manual Installation (CLI)

If you prefer the terminal, run:

clawhub install gateway-watchdog

Isolation model

  • Watchdog data is isolated under ~/.openclaw/watchdogs/gateway-discord/.
  • No edits to openclaw.json are required.
  • Default mode is read-only monitoring (GW_WATCHDOG_ENABLE_RESTART=0).
  • Automatic restart is opt-in and bounded by max attempts.

Files in this skill

  • scripts/gateway-watchdog.sh - health checks + state machine + Discord notification.
  • scripts/install-launchd.sh - installs a user LaunchAgent from template.
  • references/com.openclaw.gateway-watchdog.plist.template - launchd template.
  • references/cron-agent-turn.md - isolated cron prompt template.

Health checks

The watchdog checks:

openclaw gateway status --json
openclaw health --json --timeout <ms>

Pass criteria:

  • gateway runtime is running
  • RPC probe is healthy (when present)
  • health snapshot returns successfully

Failure classes:

  • runtime_stopped
  • rpc_probe_failed
  • health_unreachable
  • auth_mismatch
  • config_invalid

Quick start (manual run)

bash "{baseDir}/scripts/gateway-watchdog.sh"

Optional env:

export DISCORD_WEBHOOK_URL="https://discord.com/api/webhooks/..."
export DISCORD_BOT_TOKEN="discord_bot_token"
export DISCORD_CHANNEL_ID="<your_discord_channel_id>"
export GW_WATCHDOG_SOURCE="manual"
export GW_WATCHDOG_FAIL_THRESHOLD=2
export GW_WATCHDOG_COOLDOWN_SECONDS=300

Delivery priority:

  1. DISCORD_WEBHOOK_URL
  2. DISCORD_BOT_TOKEN + DISCORD_CHANNEL_ID

macOS background mode (LaunchAgent)

Install LaunchAgent (does not edit OpenClaw core config):

bash "{baseDir}/scripts/install-launchd.sh" --interval 30 --load

Check status:

launchctl list | rg "com.openclaw.gateway-watchdog"

OpenClaw cron mode (internal path)

Use isolated job and keep messaging in one channel:

openclaw cron add \
  --name "gateway-watchdog-internal" \
  --cron "*/1 * * * *" \
  --session isolated \
  --message "Run bash {baseDir}/scripts/gateway-watchdog.sh and report state changes only." \
  --announce \
  --channel discord \
  --to "channel:<your_channel_id>" \
  --best-effort-deliver

Auto-recovery policy (opt-in)

Enable bounded restart:

export GW_WATCHDOG_ENABLE_RESTART=1
export GW_WATCHDOG_MAX_RESTART_ATTEMPTS=2

Safety constraints:

  • restart only after failure threshold is met
  • max attempts enforced per incident window
  • no reinstall or destructive mutation

Backup and audit artifacts

  • state file: ~/.openclaw/watchdogs/gateway-discord/state.json
  • state backups: ~/.openclaw/watchdogs/gateway-discord/backups/state-*.json
  • event log: ~/.openclaw/watchdogs/gateway-discord/events.jsonl

The script rotates old backups and keeps recent history for rollback/debugging.

版本历史

共 2 个版本

  • v1.0.2 当前
    2026-03-29 10:20 安全 安全
  • v1.0.1
    2026-03-07 01:52

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

communication-collaboration

Himalaya

lamelas
{"answer":"通过IMAP/SMTP管理邮件的CLI。可在终端使用 `himalaya` 收发、回复、转发、搜索及整理邮件。支持多账户与MML(MIME元语言)编写邮件。"}
★ 68 📥 45,630
communication-collaboration

imap-smtp-email

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

Slack

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