360 Secure SkillHub
360 安全技能中心

OpenClaw Gateway Watchdog

核心功能:通过分层健康探测(本地网关、目标通道、通用网络),故障后自动重启OpenClaw网关,设退避机制防重启风暴。典型场景:网络中断、WSL休眠恢复、长连接失效时维持通道在线。输入输出:通过bash脚本完成安装(支持交互/无人值守/自定义通道),用systemctl管理状态、查看日志,或脚本卸载;服务后台运行,配置与日志存于用户本地目录。

zc-kama
zc-kama
热度 23.33
最近更新 2026-05-20 03:53:03
分类:自动化依赖:代码执行 / 读写文件 / 第三方 API应用场景:自动化脚本 / DevOps

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add gateway-watchdog-for-openclaw-weixin
Metadata
name
gateway-watchdog-for-openclaw-weixin
description
Install and operate a guarded watchdog that keeps OpenClaw Gateway and long-lived channels such as WeChat online by probing health, channel reachability, and general network status before restarting.
tags
["openclaw","gateway","watchdog","wechat","wsl","systemd"]
requirements
{"tools":["bash","curl","systemctl optional"]}
permissions
["Writes a user-level systemd service under ~/.config/systemd/user when available.","Writes config and logs under ~/.config/openclaw-gateway-watchdog and ~/.local/state/openclaw-gateway-watchdog.","Restarts OpenClaw Gateway through systemctl --user or openclaw gateway restart."]

OpenClaw Gateway Watchdog

Use this skill when a user wants to keep OpenClaw Gateway and message channels online after network drops, WSL sleep/resume, or long-lived connection failures.

Install

From this skill folder, run:

bash install-watchdog.sh

The installer works with defaults. It prompts for the main channel probe URL when running interactively, but pressing Enter is enough for the default WeChat probe.

For unattended install:

bash install-watchdog.sh --yes

For a custom channel:

bash install-watchdog.sh --channel-url "https://your-channel.example.com/health"

Operate

systemctl --user status gateway-watchdog
journalctl --user -u gateway-watchdog -f
bash ~/.local/share/openclaw-gateway-watchdog/uninstall-watchdog.sh

If user systemd is unavailable, the installer starts a direct background fallback and stores its pid under ~/.local/state/openclaw-gateway-watchdog/watchdog.pid.

Safety Model

The watchdog restarts only after layered checks:

  1. Local gateway health URL or TCP port.
  2. Main channel URL.
  3. General network URLs to avoid restarting during whole-machine network failure.
  4. Backoff and hourly restart limits to avoid restart storms.

Tell users to review ~/.config/openclaw-gateway-watchdog/watchdog.env before publishing, sharing logs, or reporting issues.