← 返回
开发者工具 中文

Openclaw Health Guardian

Monitors OpenClaw Gateway on macOS, auto-restarts on failure with 180s cooldown and max 5 restarts/hour to prevent restart loops.
监控 macOS 上的 OpenClaw Gateway,故障时自动重启,冷却时间180秒,每小时最多重启5次,防止重启循环。
zhilshi
开发者工具 clawhub v1.0.3 2 版本 100000 Key: 无需
★ 0
Stars
📥 660
下载
💾 9
安装
2
版本
#gateway#health#latest#monitoring#openclaw#stable

概述

name: openclaw-health-guardian

description: Deploy OpenClaw health monitoring with auto-restart, cooldown (180s), and rate limiting (5/hour). Use when: (1) setting up OpenClaw health checks, (2) auto-restarting failed Gateway, (3) monitoring OpenClaw status, (4) deploying health daemon on macOS.


metadata:

{

"openclaw":

{

"emoji": "🛠️",

"requires": { "bins": ["node"] }

},

}


OpenClaw Health Guardian

Auto-monitor and recover OpenClaw Gateway with intelligent rate limiting.

Quick Start

Install health guardian:

bash ~/.openclaw/skills/openclaw-health-guardian/scripts/install.sh

Verify installation:

launchctl list | grep openclaw

When to Use

  • Gateway frequently stops responding
  • Need automatic recovery without manual intervention
  • Running OpenClaw on macOS with LaunchAgent support
  • Want cooldown protection against restart loops

Features

FeatureValueDescription
-----------------------------
Check Interval5 minutesLaunchAgent StartInterval
Cooldown180 secondsMinimum between restarts
Rate Limit5/hourMax restarts per hour
HTTP Timeout5 secondscurl --max-time
Auto NotifyTerminal popupAppleScript alert on failure

Workflow

  1. Install guardian

```bash

bash ~/.openclaw/skills/openclaw-health-guardian/scripts/install.sh

```

  1. Verify service running

```bash

launchctl list | grep com.openclaw.healthcheck

```

  1. Monitor logs

```bash

tail -f ~/.openclaw/logs/health-check.log

```

  1. Test manually (optional)

```bash

bash ~/.openclaw/scripts/openclaw-health-check.sh

```

Commands

CommandPurpose
------------------
`launchctl list \grep openclaw`Check service status
tail -f ~/.openclaw/logs/health-check.logView real-time logs
bash ~/.openclaw/scripts/openclaw-health-check.shManual check
launchctl unload ~/Library/LaunchAgents/com.openclaw.healthcheck.plistStop service
launchctl load ~/Library/LaunchAgents/com.openclaw.healthcheck.plistStart service

File Structure

After installation:

~/.openclaw/
├── scripts/
│   └── openclaw-health-check.sh    # Main script
├── state/
│   ├── last_restart                # Timestamp
│   ├── restart_count               # Hourly counter
│   └── hour_marker                 # Hour tracking
└── logs/
    ├── health-check.log            # Main log
    ├── health-check-daemon.log     # Daemon stdout
    └── health-check-daemon-error.log # Daemon stderr

~/Library/LaunchAgents/
└── com.openclaw.healthcheck.plist  # LaunchAgent config

Log Examples

Normal:

[2026-03-16 10:28:47] No issues found. OpenClaw is healthy!

Cooldown triggered:

[2026-03-16 10:30:05] 冷却期内 (120s/180s),跳过重启操作

Rate limit triggered:

[2026-03-16 10:30:05] 本小时已达重启上限(5次),跳过

Restart executed:

[2026-03-16 10:30:02] 已记录重启事件 (冷却: 180s, 限流: 5/小时)
[2026-03-16 10:30:05] Gateway restart completed successfully

Uninstall

# Stop and remove service
launchctl unload ~/Library/LaunchAgents/com.openclaw.healthcheck.plist
rm ~/Library/LaunchAgents/com.openclaw.healthcheck.plist

# Remove scripts and logs
rm ~/.openclaw/scripts/openclaw-health-check.sh
rm -rf ~/.openclaw/state/
rm ~/.openclaw/logs/health-check*.log

Requirements

  • macOS 10.14+
  • OpenClaw installed
  • User home directory write permissions

References

  • references/technical-details.md - Implementation details
  • references/troubleshooting.md - Common issues

版本历史

共 2 个版本

  • v1.0.3 当前
    2026-05-01 10:15 安全 安全
  • v1.0.1
    2026-03-20 05:02 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

CodeConductor.ai

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

Gog

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

Agent Browser

matrixy
专为AI智能体优化的无头浏览器自动化CLI,支持无障碍树快照和基于引用的元素选择。
★ 427 📥 118,341