微算力 · API 导航与自营网关
API 接入 EN
未登录登录
🛡️

网关故障自动修复,运维无忧

Gateway Auto-Fix · v2.0.0
效率 安全 B 级 作者 nwcalvin 公开目录收录
985 下载 0 安装 3.4k 收藏 12 浏览

简介

自动监控 OpenClaw 网关 RPC 状态,故障时自动修复重启,无需人工值守

原始描述

Automatically monitor OpenClaw gateway status and fix when RPC probe fails. Uses OpenClaw cron system - just install and it works!

通过你的 Agent 添加

安装目录:gateway-auto-fix/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/gateway-auto-fix/
Codex CLI~/.codex/skills/gateway-auto-fix/
DeepSeek Harness~/.agents/skills/gateway-auto-fix/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

技能正文


name: gateway-auto-fix description: Automatically monitor OpenClaw gateway status and fix when RPC probe fails. Uses OpenClaw cron system - just install and it works!

Gateway Auto-Fix Skill

Overview

This skill automatically monitors the OpenClaw gateway and fixes it when the RPC probe fails. It uses OpenClaw's built-in cron system for scheduling.

What It Does

  1. Checks openclaw gateway status every minute
  2. Detects "RPC probe: failed" in the output
  3. Automatically runs:
    • openclaw doctor --fix to fix config issues
    • openclaw gateway restart to restart the gateway
  4. Logs all actions to /tmp/openclaw-auto-fix.log

Quick Install (Automatic)

npx clawhub install gateway-auto-fix

That's it! The skill will:

  • ✅ Add OpenClaw cron job (every 1 minute)
  • ✅ Create the script
  • ✅ Start monitoring

Manual Install (If ClawHub Not Available)

# 1. Copy the script to workspace
mkdir -p ~/.openclaw-it/workspace
cp /path/to/gateway-auto-fix/openclaw-auto-fix.sh ~/.openclaw-it/workspace/

# 2. Make executable
chmod +x ~/.openclaw-it/workspace/openclaw-auto-fix.sh

# 3. Add OpenClaw cron job
openclaw cron add \
  --name "gateway-auto-fix" \
  --every "1m" \
  --message "Run: ~/.openclaw-it/workspace/openclaw-auto-fix.sh" \
  --no-deliver

Manual Uninstall

# Remove cron job
openclaw cron rm gateway-auto-fix

# Remove script
rm ~/.openclaw-it/workspace/openclaw-auto-fix.sh

Usage

Check Cron Status

openclaw cron list
openclaw cron status

Check Logs

tail -f /tmp/openclaw-auto-fix.log

Run Manually

~/.openclaw-it/workspace/openclaw-auto-fix.sh

# Or via OpenClaw cron
openclaw cron run gateway-auto-fix

Troubleshooting

Check if cron is running:

openclaw cron status

Check gateway:

openclaw gateway status

Run manually:

openclaw cron run gateway-auto-fix

Files Created

  • Script: ~/.openclaw-it/workspace/openclaw-auto-fix.sh
  • Log: /tmp/openclaw-auto-fix.log
  • Cron: OpenClaw built-in (every 1 minute)

Configuration

Change Interval

# Remove old job
openclaw cron rm gateway-auto-fix

# Add new job with different interval (e.g., 5 minutes)
openclaw cron add \
  --name "gateway-auto-fix" \
  --every "5m" \
  --message "Run: ~/.openclaw-it/workspace/openclaw-auto-fix.sh" \
  --no-deliver

Complete Manual Setup Commands

# Step 1: Create workspace
mkdir -p ~/.openclaw-it/workspace

# Step 2: Create the script
cat > ~/.openclaw-it/workspace/openclaw-auto-fix.sh << 'EOF'
#!/bin/bash
LOG_FILE="/tmp/openclaw-auto-fix.log"
echo "=== $(date) ===" >> $LOG_FILE
STATUS_OUTPUT=$(openclaw gateway status 2>&1)
echo "$STATUS_OUTPUT" >> $LOG_FILE
if echo "$STATUS_OUTPUT" | grep -q "RPC probe: failed"; then
    echo "RPC probe FAILED! Running auto-fix..." >> $LOG_FILE
    openclaw doctor --fix 2>&1 >> $LOG_FILE
    openclaw gateway restart 2>&1 >> $LOG_FILE
    echo "Auto-fix completed at $(date)" >> $LOG_FILE
else
    echo "Gateway is healthy" >> $LOG_FILE
fi
echo "---" >> $LOG_FILE
EOF

# Step 3: Make executable
chmod +x ~/.openclaw-it/workspace/openclaw-auto-fix.sh

# Step 4: Add OpenClaw cron job
openclaw cron add \
  --name "gateway-auto-fix" \
  --every "1m" \
  --message "Run: ~/.openclaw-it/workspace/openclaw-auto-fix.sh" \
  --no-deliver

# Step 5: Verify
openclaw cron list

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

monitoringauto-healingopenclawgatewaycronbashdevops-automation

同类 Skill