家庭实验室仪表板:监控自托管服务和 Docker - Openclaw Skills

作者:互联网

2026-04-17

AI教程

什么是 家庭实验室仪表板?

此技能使用户能够为其自托管环境生成实时状态仪表板。它提供系统运行状况、资源利用率和应用程序可用性的集中视图,使其成为家庭实验室爱好者 Openclaw Skills 收藏中不可或缺的补充。

通过利用标准 Linux 实用程序和 Docker 集成,该技能可自动收集关键性能指标和服务状态。它将原始技术数据转换为可读、可操作的仪表板,在潜在问题演变成严重故障之前将其突出显示。

下载入口:https://github.com/openclaw/skills/tree/main/skills/sa9saq/homelab-dashboard

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install homelab-dashboard

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 homelab-dashboard。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

家庭实验室仪表板 应用场景

  • 监控 Docker 容器的运行状况和运行时间。
  • 检查系统资源使用情况,包括 CPU 负载、内存和磁盘空间。
  • 验证自托管 Web 服务的 HTTP 连接性和响应代码。
  • 跟踪特定 systemd 服务的激活或失败状态。
  • 为家庭实验室维护生成统一的警报摘要。
家庭实验室仪表板 工作原理
  1. 使用 nproc、free 和 df 等原生 Linux 命令扫描系统资源。
  2. 查询 Docker 守护进程以检索所有容器的状态和端口映射。
  3. 使用 curl 执行 HTTP 健康检查,以确定指定 URL 的响应能力。
  4. 审计 systemd 单元以确保关键后台服务无错误运行。
  5. 将所有收集的指标编译成带有视觉状态指示器的结构化 Markdown 仪表板。
  6. 根据预定义阈值评估数据,以触发警告或严重警报。

家庭实验室仪表板 配置指南

此技能需要具有标准系统工具的 Linux 环境。基本功能不需要外部 API 密钥。请确保以下工具可用:

# 检查核心实用程序
free -h
df -h
uptime

# 可选:确保已安装 Docker 和 Curl
which docker
which curl

家庭实验室仪表板 数据架构与分类体系

家庭实验室仪表板将基础设施数据组织为以下类别和格式:

类别 数据点 视觉指示器
系统资源 CPU 负载、内存使用、磁盘空间 状态图标(正常/警告/严重)
Docker 状态 容器名称、运行时间、端口 健康徽章
Web 服务 HTTP 代码、响应时间 状态徽章(健康/错误/宕机)
警报 阈值违规、失败的服务 可操作的要点

所有日期和时间均根据系统的本地时区进行格式化,以便在 Openclaw Skills 中进行准确记录。

description: Generate a status dashboard for self-hosted services, Docker containers, and homelab infrastructure.

Homelab Dashboard

Check health and status of homelab services and infrastructure.

Use when checking service status, monitoring Docker containers, or getting a homelab overview.

Requirements

  • Linux system with standard tools (free, df, uptime)
  • Optional: Docker, systemd, curl
  • No API keys needed

Instructions

  1. System resources:

    nproc                          # CPU cores
    uptime                         # load average
    free -h                        # memory usage
    df -h / /mnt/* 2>/dev/null     # disk usage (root + mounts)
    
  2. Docker containers (if Docker is installed):

    docker ps --format 'table {{.Names}}	{{.Status}}	{{.Ports}}' 2>/dev/null
    docker ps -a --filter "status=exited" --format '{{.Names}}	{{.Status}}' 2>/dev/null
    
  3. HTTP health checks (if user provides URLs):

    curl -s -o /dev/null -w "%{http_code}" --connect-timeout 5 --max-time 10 
    
    • 200-299: ?? Healthy
    • 300-399: ?? Redirect
    • 400+: ?? Error
    • No response: ?? Down
  4. Systemd services (if specified):

    systemctl is-active 
    systemctl is-failed   # check for failed services
    
  5. Output format:

    ?? Homelab Dashboard — 2025-01-15 14:30 JST
    
    ## ?? System Resources
    | Resource | Usage | Status |
    |----------|-------|--------|
    | CPU | 4 cores, load 1.2 | ?? Normal |
    | Memory | 6.2G / 16G (39%) | ?? Normal |
    | Disk / | 120G / 500G (24%) | ?? Normal |
    | Disk /mnt/hdd | 2.1T / 2.7T (78%) | ?? Warning |
    
    ## ?? Docker Containers
    | Container | Status | Ports |
    |-----------|--------|-------|
    | nginx | ?? Up 3 days | 80, 443 |
    | postgres | ?? Up 3 days | 5432 |
    | redis | ?? Exited (1) 2h ago | — |
    
    ## ?? Services
    | Service | Status | Response |
    |---------|--------|----------|
    | Nextcloud | ?? 200 OK | 142ms |
    | Gitea | ?? Connection refused | — |
    
    ## ?? Alerts
    - ?? redis container is down (exited with code 1)
    - ?? Gitea is unreachable
    - ?? /mnt/hdd disk usage at 78% — consider cleanup
    
  6. Alert thresholds:

    • Disk > 85%: ?? Critical
    • Disk > 70%: ?? Warning
    • Memory > 90%: ?? Critical
    • Load > 2× CPU cores: ?? Warning
    • Any stopped container or failed service: ??

Edge Cases

  • Docker not installed: Skip container section, note it in output.
  • Permission denied: Some commands need sudo. Report what couldn't be checked.
  • Remote hosts: Use SSH (ssh user@host "command") for checking remote machines.
  • No services specified: Run a general system check + Docker containers only.

Security Considerations

  • Don't expose internal service URLs or IPs in shared outputs.
  • Health check URLs may contain tokens — redact them in output.

相关推荐