360 Secure SkillHub
360 安全技能中心

OpenClaw Watchdog

该 Skill 以每 60 秒一次的频率检查 OpenClaw 网关健康状态,累计连续 3 次失败后执行网关重启命令,并把事件写入本地日志文件;支持启动、状态查询、日志查看和停止等命令,并可作为 systemd 服务在重启后继续运行。

mirror76
mirror76
热度 21.00
最近更新 2026-04-09 11:58:25
分类:自动化依赖:代码执行 / 读写文件应用场景:自动化脚本 / DevOps / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add cromabelt-watchdog
Metadata
name
openclaw-watchdog
slug
cromabelt-watchdog
title
OpenClaw Watchdog — Auto-restart when your gateway crashes
description
Checks your OpenClaw gateway every 60 seconds. Restarts it automatically if it freezes. Runs in the background, logs events, survives reboots.
tags
["openclaw","watchdog","auto-restart","monitoring","server"]
version
1.2.0
author
Cromabelt Studios
contact
cromabeltstudio@gmail.com
platform
ClawHub
price
FREE
category
Server Maintenance
changelog
v1.2 — runs entirely inside the agent. No external script setup. Self-contained commands.
security
This skill does NOT: - Send data to external servers - Access credentials or API keys - Modify system files outside the OpenClaw workspace - Make network calls to third parties It only: reads the gateway health endpoint, runs openclaw gateway restart, writes logs locally.

OpenClaw Watchdog

A background watchdog for OpenClaw. It checks if your gateway is running, and restarts it if it stops responding.

What it does

  • Pings the gateway every 60 seconds
  • Counts consecutive failures
  • After 3 failures in a row, runs openclaw gateway restart
  • Logs all events to /tmp/watchdog.log
  • Can run as a systemd service (survives reboots)

Trigger phrases

  • "start watchdog"
  • "is my agent online"
  • "watchdog status"
  • "check OpenClaw health"
  • "keep OpenClaw running"

How to run

Start the watchdog: Just tell me "start watchdog" and I'll run it for you. No setup needed.

Check if it's running: Tell me "watchdog status" and I'll show you the last log entries and process state.

Check the logs: Tell me "watchdog logs" and I'll tail the last entries from /tmp/watchdog.log.

Stop it: Tell me "stop watchdog".

How it works

Every 60 seconds, the watchdog checks:

  • Is the gateway responding? → log "All clear"
  • Is the gateway down? → increment failure counter
  • 3 failures in a row? → restart the gateway and log the restart

Log format

2026-04-09 03:30:00 WATCHDOG: Watchdog started — monitoring every 60s
2026-04-09 03:30:00 WATCHDOG: All clear
2026-04-09 03:31:00 WATCHDOG: Check failed (1/3) — alive=True responding=False
2026-04-09 03:32:00 WATCHDOG: OPENCLAW DOWN — restarting gateway...
2026-04-09 03:32:30 WATCHDOG: Restart complete.

Who needs this

  • If your OpenClaw gateway freezes or crashes frequently
  • If you run OpenClaw on a VPS and can't monitor it 24/7
  • If you want automatic recovery without manually restarting

Requirements

  • Python 3.x
  • OpenClaw gateway running on the same server
  • curl available for health checks