任务监控面板
OpenClaw实时
restart-guard 提供一套完整的 OpenClaw Gateway 安全重启机制,在重启前自动保存会话上下文,重启后执行健康验证,并在异常时发送告警通知。
网关升级或配置变更时,业务会话常因重启中断导致用户体验受损。本机制在重启前自动保存完整上下文,重启后验证服务健康状态,确保网关平滑过渡。若验证失败即时告警,帮助运维团队快速介入,避免故障扩大,保障业务连续性。
落地案例:某电商平台需调整网关限流策略,运维人员执行:python3 scripts/write_context.py –config config.yaml –reason "config change" –verify 'openclaw health –json' 'ok' –resume "report restart result to user"。系统生成上下文文件后触发重启,守护进程持续监控。重启完成后自动运行健康检查,确认返回"ok"后标记成功;若超时或输出不符,立即通过多渠道发送告警并保留诊断日志,便于快速回滚。
前置条件
openclaw.json 中设置 commands.restart: truegateway 和 exec 工具权限config.example.yaml 填写参数后通过 --config 传入安装指令
# 克隆技能仓库
git clone https://github.com/openclaw/skills.git
# 进入技能目录
cd skills/zjianru/restart-guard
# 复制并编辑配置文件
cp config.example.yaml config.yaml
# 编辑 config.yaml 填入通知渠道等参数
执行流程
python3 scripts/write_context.py \
--config config.yaml \
--reason "config change" \
--verify 'openclaw health --json' 'ok' \
--resume "report restart result to user"
python3 scripts/restart.py --config config.yaml --reason "config change"
python3 scripts/postcheck.py --config config.yaml
见下方输入与输出表格。
| 项目 | 内容 |
|---|---|
| 输入 | 重启原因、配置文件路径、验证命令与预期输出、恢复步骤描述 |
| 输出 | 上下文 YAML 文件、重启结果通知、健康验证报告、故障诊断日志与告警 |
| 适用人群 | 需要安全重启 OpenClaw Gateway 并保留上下文的运维人员与自动化 Agent |
| 不包含 | 网关安装初始化、其他网关类型重启、无权限环境的重启操作 |
start_new_session=True 实现重启后存活,错误配置会导致监控中断原始链接:https://github.com/openclaw/skills/tree/main/skills/zjianru/restart-guard/SKILL.md
来源类型:GitHub 仓库