Gateway Monitor Auto Restart
简介
Gateway Monitor Auto Restart
原始描述
Monitors OpenClaw gateway every 3 hours, auto-restarts if unresponsive, diagnoses startup issues, and rotates logs with 7-day retention.
通过你的 Agent 添加
安装目录:gateway-monitor-auto-restart/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心用法
Gateway Monitor Auto-Restart Skill 是一款专为 OpenClaw 网关设计的自动化监控守护工具。安装后,它会在用户系统中创建 cron 定时任务,每 3 小时自动执行一次健康检查:通过 pgrep、lsof 等系统命令检测网关进程状态和网络端口响应。一旦发现网关无响应,立即触发智能重启流程——优先尝试标准重启,失败时自动降级使用 launchctl 服务管理进行深度恢复。所有操作均记录带时间戳的本地日志,并执行 7 天自动轮换清理。
显著优点
零依赖架构是该 Skill 的最大亮点。代码仅依赖系统内置命令(bash、crontab、launchctl、pgrep),彻底规避第三方包供应链攻击风险。代码结构透明简洁,105 行脚本无混淆或动态代码加载,安全可审计。功能设计务实:智能诊断模块能在重启失败时定位问题,"已运行"状态的错误处理机制避免重复操作,7 天日志轮转防止磁盘膨胀。对于需要 24/7 稳定运行的自托管网关场景,这是轻量可靠的免维护方案。
潜在缺点与局限性
首先,持久化残留风险:cron 任务通过 crontab 直接写入用户定时表,删除 Skill 文件后定时任务仍会残留,需手动 crontab -e 清理,作者未提供卸载脚本。其次,平台锁定明显:launchctl 命令表明该工具专为 macOS 设计,Linux 系统用户需自行修改服务管理命令。第三,权限边界模糊:进程终止和网络端口操作需要特定系统权限,在多用户或生产环境中可能造成误杀其他进程的风险。最后,T3 来源意味着缺乏企业级维护承诺,长期更新依赖社区反馈。
适合的目标群体
- 个人开发者或小团队自托管 OpenClaw 网关,缺乏专职运维资源
- macOS 用户需要轻量级网关高可用保障,不愿部署复杂监控体系
- 追求零依赖、可审计代码的安全敏感用户
- 开发测试环境中频繁遭遇网关崩溃,需要自动恢复机制
使用风险
系统级操作风险:进程管理命令在权限配置不当情况下可能影响其他服务。持久化残留风险:卸载不彻底可能导致僵尸 cron 任务持续运行。平台兼容性风险:Linux 用户需自行适配 systemd 等替代方案。T3 来源风险:个人开发者维护,建议持续关注社区安全反馈。建议在隔离环境(如专用测试机或个人 Mac)中先行验证,确认网关进程识别逻辑(基于名称匹配)不会误伤其他应用后再投入生产使用。
技能正文
Gateway Monitor Auto-Restart Skill
Automatically monitors the OpenClaw gateway status and restarts it if it becomes unresponsive. Features 3-hour checks, smart restart logic, issue diagnosis, and 7-day log rotation.
Description
This skill provides comprehensive monitoring for the OpenClaw gateway with automatic restart capabilities. It includes:
- Health checks every 3 hours
- Smart restart mechanism when gateway is down
- Issue diagnosis when startup fails
- 7-day log rotation system
- Fast recovery system that prioritizes quick gateway restart
Features
- Automatic Monitoring: Checks gateway status every 3 hours
- Smart Restart: Restarts gateway when it becomes unresponsive
- Issue Diagnosis: Identifies and reports startup issues
- Fast Recovery: Prioritizes quick gateway restart
- Log Management: Maintains logs with 7-day rotation
- Error Handling: Gracefully handles "already running" errors
Usage
The skill automatically sets up a cron job that runs the monitoring script every 3 hours. The monitoring system will:
- Check if the gateway is responsive
- If unresponsive, attempt to restart it
- If restart fails, diagnose the issue
- Log all activities with timestamp
- Rotate logs older than 7 days
Requirements
- OpenClaw gateway installed and configured
- Proper permissions to manage gateway service
- Cron access for scheduling checks
Configuration
No additional configuration required. The skill automatically installs the monitoring system with optimal settings.
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。