返回顶部
q

qclaw-watchdogqclaw看门狗

|

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
166
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

qclaw-watchdog

技能名称: qclaw-watchdog

详细描述:

QClaw Watchdog / QClaw 看门狗

功能 Features

  • - 自动监控 - 可配置间隔检查 QClaw 状态
  • 自动修复 - 检测到异常时自动重启
  • 飞书通知 - 通过飞书发送状态通知
  • 远程控制 - 支持通过飞书发送指令
  • 配置分离 - 配置文件与代码分离
  • 自动更新 - 支持一键更新到最新版本

支持的指令 Commands

指令 Command说明 Description
状态 / status检查 QClaw 状态
重启 / restart
重启 QClaw | | 启动 / start | 启动 QClaw | | 退出 / quit | 退出 QClaw | | 配置 / config | 显示当前配置 | | 帮助 / help | 显示帮助 |

配置 Configuration

配置文件 (config.json)

json
{
feishu: {
app_id: your-app-id,
app_secret: your-secret,
user_id: your-open-id
},
qclaw: {
health_url: http://127.0.0.1:28789/health
},
watchdog: {
checkintervalms: 180000,
restartdelayms: 10000,
max_retries: 3
},
logs: {
main_log: ./watchdog.log,
command_log: ./commands.log
}
}

配置项说明

配置项默认值说明
checkintervalms180000巡检间隔(毫秒),默认3分钟
restartdelayms
10000 | 重启延迟(毫秒),默认10秒 | | max_retries | 3 | 最大重试次数 |

环境变量

也可以通过环境变量覆盖配置:

bash
export FEISHUAPPID=your-app-id
export FEISHUAPPSECRET=your-secret
export FEISHUUSERID=your-open-id
export CHECKINTERVALMS=300000

安装 Installation

1. 创建配置文件

bash
./init-config.sh

编辑 config.json,填入你的飞书应用配置。

2. 启动看门狗

bash

前台运行


./start.sh

后台运行

nohup ./start.sh >> watchdog.log 2>&1 &

3. 开机自启 (macOS)

bash

编辑 plist,修改路径


vim com.user.qclaw-watchdog.plist

复制到 LaunchAgents

cp com.user.qclaw-watchdog.plist ~/Library/LaunchAgents/ launchctl load ~/Library/LaunchAgents/com.user.qclaw-watchdog.plist

更新 Update

自动更新

bash

检查更新


./update.sh --check

从 GitHub 更新

./update.sh --github username/qclaw-watchdog

一键更新

./update.sh

强制更新

./update.sh --force

手动更新

bash

备份配置


cp config.json config.json.bak

拉取最新代码

git pull

恢复配置

cp config.json.bak config.json

重启服务

发布 Publish

发布到 GitHub

bash

安装 GitHub CLI (如果未安装)


brew install gh

登录 GitHub

gh auth login

发布

./publish.sh --github yourname/qclaw-watchdog

发布后,其他用户可以通过以下方式安装:
bash

克隆仓库


git clone https://github.com/yourname/qclaw-watchdog.git

配置

./init-config.sh

启动

./start.sh

文件结构

qclaw-watchdog/
├── SKILL.md # 说明文档
├── watchdog.js # 主程序
├── config.json # 配置文件(可选)
├── start.sh # 启动脚本
├── update.sh # 更新脚本
└── init-config.sh # 配置初始化脚本

工作原理

┌─────────────┐ WebSocket ┌─────────────┐
│ 飞书服务器 │ ←──────────────→ │ 看门狗 │
└─────────────┘ └──────┬───────┘

HTTP ↓
GET ┌─────────────┐
│ QClaw │
│ Gateway │
└─────────────┘

  1. 1. WebSocket 连接 - 看门狗通过 WebSocket 接收飞书消息
  2. 状态检查 - 定期检查 QClaw Gateway 健康状态
  3. 自动修复 - 异常时自动重启 QClaw
  4. 消息通知 - 通过飞书发送状态通知

飞书应用配置

1. 创建飞书企业自建应用

  1. 1. 打开 飞书开发者后台
  2. 创建企业自建应用
  3. 添加权限:
- im:message:sendasbot - 发送消息 - im:message:receive - 接收消息
  1. 4. 启用事件订阅(长连接模式)
  2. 发布应用

2. 获取配置信息

配置项获取方式
App ID应用详情 → 凭证与基础信息
App Secret
应用详情 → 凭证与基础信息 | | User Open ID | 见下文 |

3. 获取用户 Open ID

打开飞书 API 调试页面:

https://open.feishu.cn/api-explorer/cli_a9333bca0c78dceb?apiName=create&project=im&resource=message&version=v1

  1. 1. 在页面中找到「发送消息 API」
  2. 查询参数 receiveidtype 选择 openid
  3. 在请求体中输入用户的 openid(可以用用户的飞书 ID 或手机号查询)
  4. 点击发送,即可看到返回的 open_id

注意事项

  • - 确保 Node.js >= 18 已安装
  • 飞书应用需要已发布才能接收消息
  • 看门狗独立运行,QClaw 挂了也能监控和告警
  • 配置文件变更后需要重启生效

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 qclaw-watchdog-1776176524 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 qclaw-watchdog-1776176524 技能

通过命令行安装

skillhub install qclaw-watchdog-1776176524

下载

⬇ 下载 qclaw-watchdog v1.0.0(免费)

文件大小: 10.19 KB | 发布时间: 2026-4-17 15:52

v1.0.0 最新 2026-4-17 15:52
Initial release of qclaw-watchdog:

- Monitors and auto-restarts QClaw when issues are detected.
- Sends status alerts and receives commands via Feishu.
- Runs independently from QClaw, with status checks, automatic restarts, and remote control.
- Supports configurable settings, separated config files, and environment variable overrides.
- Includes one-click update, easy installation scripts, and GitHub publishing tools.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部