← 返回
未分类 中文

System Healthcheck

Three-tier system health monitoring (L1/L2/L3) with heartbeat mechanism. Zero external dependencies, i18n support, console output only.
三级系统健康监控(L1/L2/L3),支持心跳机制。零外部依赖,支持国际化,仅控制台输出。
lim1202 lim1202 来源
未分类 clawhub v1.0.1 1 版本 100000 Key: 无需
★ 1
Stars
📥 565
下载
💾 0
安装
1
版本
#latest

概述

system-healthcheck

Three-tier system health monitoring for OpenClaw

English | 简体中文


Features

  • L1 Fast Check (<200ms): Definition file existence check
  • L2 Hourly Check (<5s): System resources, services, logs
  • L3 Daily Audit (<60s): Comprehensive system audit
  • Heartbeat Mechanism: Quiet when healthy, alert on issues
  • i18n Support: Auto-detect language (en/zh-CN)
  • Zero External Dependencies: Works out of the box

Installation

clawhub install system-healthcheck

Or manually:

git clone https://github.com/your-username/system-healthcheck.git ~/.openclaw/skills/system-healthcheck

Quick Start

1. L1 Fast Check (Manual)

cd ~/.openclaw/skills/system-healthcheck
python scripts/l1_fast_check.py

2. L2 Hourly Check (Manual)

python scripts/l2_hourly_check.py

3. Setup Crontab

cat templates/crontab_example.txt
# Copy and edit crontab
crontab -e

4. Heartbeat Check

python scripts/heartbeat.py

Configuration

Edit config/default_config.yaml:

# Internationalization
i18n:
  auto_detect: true  # Auto-detect system language
  # locale: zh-CN    # Or specify manually

# Thresholds
thresholds:
  disk_warning: 80      # Disk warning (%)
  disk_critical: 95     # Disk critical (%)
  memory_warning_mb: 500  # Memory warning (MB)
  log_size_mb: 100      # Log size warning (MB)

# Heartbeat
heartbeat:
  enabled: true
  work_hours_start: 9
  work_hours_end: 18
  quiet_on_ok: true  # Silent when all OK

Output Examples

L2 Hourly Check

🦞 System Health Check · 2026-03-23 09:00:00

✅ Disk Usage: 45% (threshold: 80%)
✅ Memory Usage: 1.2GB / 8GB
✅ Cron Service: Running
✅ OpenClaw Gateway: Healthy
✅ Log Files: 12MB

━━━━━━━━━━━━━━━━━━━━━━━━
✅ All checks passed
Duration: 1.2s

Heartbeat (All OK)

HEARTBEAT_OK

Heartbeat (Issues Detected)

🦞 Heartbeat Check · 2026-03-23 14:30:00

⚠️ Disk Usage: 85% (exceeds 80%)
✅ Memory Usage: 2.1GB / 8GB
...

Scripts

ScriptPurposeFrequency
----------------------------
l1_fast_check.pyDefinition files checkBefore conversations
l2_hourly_check.pySystem health checkHourly (cron)
l3_daily_audit.pyComprehensive auditDaily 08:00 (cron)
heartbeat.pyWork-hours heartbeatEvery 30min (cron)

CLI Options

# JSON output
python scripts/l2_hourly_check.py --json

# Quiet mode (exit code only)
python scripts/l2_hourly_check.py --quiet

# Force output (heartbeat)
python scripts/heartbeat.py --force

Exit Codes

  • 0: All checks passed
  • 1: One or more checks failed

Internationalization

Supported languages:

  • en - English
  • zh-CN - 简体中文

Auto-detected from system locale. Override with:

export OPENCLAW_LOCALE=zh-CN
python scripts/l2_hourly_check.py

Requirements

  • Python 3.8+
  • Linux or macOS
  • No external dependencies (optional: rich for colorful output, pyyaml for config)

License

MIT


Contributing

Contributions welcome! Please read CONTRIBUTING.md first.


Changelog

v1.0.0 (2026-03-23)

  • Initial release
  • L1/L2/L3 checks
  • Heartbeat mechanism
  • i18n support (en/zh-CN)

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-03-30 22:33 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

it-ops-security

Free Ride - Unlimited free AI

shaivpidadi
管理OpenClaw的OpenRouter免费AI模型,自动按质量排名模型,配置速率限制备用方案,并更新opencla...
★ 470 📥 78,119
it-ops-security

MoltGuard - Security & Antivirus & Guardrails

thomas-security
MoltGuard — OpenClaw 安全守卫,由 OpenGuardrails 提供。安装后可防止您和您的用户受到提示注入、数据泄露及恶意行为的侵害。
★ 116 📥 30,953
it-ops-security

OpenClaw Backup

alex3alex
备份与恢复 OpenClaw 数据。适用于创建备份、设置自动备份计划、从备份恢复或管理备份轮转。处理 ~/.openclaw 目录归档并包含适当的排除规则。
★ 90 📥 30,977