← 返回
开发者工具 中文

Openclaw Guardian

Deploy and manage a Guardian watchdog process for OpenClaw Gateway. Provides automated health monitoring, self-repair via `doctor --fix`, git-based workspace...
为 OpenClaw Gateway 部署和管理 Guardian 守护进程。提供自动健康监控、通过 `doctor --fix` 进行自我修复、基于 Git 的工作区...
leoyeai
开发者工具 clawhub v0.1.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 1,166
下载
💾 15
安装
1
版本
#latest

概述

OpenClaw Guardian

Guardian is a standalone bash watchdog that keeps OpenClaw Gateway alive 24/7.

Repair ladder:

  1. Detect Gateway down (every 30s)
  2. Run openclaw doctor --fix (up to 3 attempts)
  3. If still down → git reset --hard to last stable commit, restart Gateway
  4. If all fails → cooldown 300s, resume monitoring
  5. Daily automatic git snapshot of workspace

Setup Steps

1. Initialize git (required for rollback)

cd ~/.openclaw/workspace
git config --global user.email "guardian@example.com"
git config --global user.name "Guardian"
git init && git add -A && git commit -m "initial"

Skip if repo already exists. Without git, doctor --fix still works; rollback is skipped.

2. Install guardian.sh

Copy scripts/guardian.sh from this skill to ~/.openclaw/guardian.sh:

cp scripts/guardian.sh ~/.openclaw/guardian.sh
chmod +x ~/.openclaw/guardian.sh

3. Start Guardian

Container / no systemd (nohup):

nohup ~/.openclaw/guardian.sh >> /tmp/openclaw-guardian.log 2>&1 &

Linux VPS with systemd: See references/setup.md → Pattern B.

4. Auto-start on container restart

Add to ~/.openclaw/start-gateway.sh (before the final exec line):

pkill -f "guardian.sh" 2>/dev/null || true
nohup /home/ubuntu/.openclaw/guardian.sh >> /tmp/openclaw-guardian.log 2>&1 &

5. Optional: Discord alerts

export DISCORD_WEBHOOK_URL="https://discord.com/api/webhooks/..."

Or add to start-gateway.sh as a persistent export.

Verify

pgrep -a -f "guardian.sh"          # confirm process running
tail -f /tmp/openclaw-guardian.log  # watch live logs

Configuration

All settings via environment variables. Defaults work out of the box.

See references/setup.md for full variable reference, systemd config, and architecture diagram.

Notes

  • Guardian coexists with gw-watchdog.sh — run both for layered resilience
  • Rollback targets the 2nd-newest non-auto commit (skips daily-backup, rollback, auto-backup commits)
  • Log path: /tmp/openclaw-guardian.log

版本历史

共 1 个版本

  • v0.1.0 当前
    2026-03-30 04:37 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

Openclaw Master Skills Clawhub Pkg

leoyeai
精选 1709+ 最优秀的 OpenClaw 技能——AI 工具、效率、营销、前端、移动、后端、DevOps 等。每周由 MyClaw 更新。
★ 4 📥 4,330
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,809
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 68 📥 180,261