服务器健康代理:实时 VPS 与 Docker 监控 - Openclaw Skills

作者:互联网

2026-03-27

AI教程

什么是 服务器健康代理?

服务器健康代理是专门为需要立即了解基础设施状态的 DevOps 工程师和系统管理员设计的 Openclaw Skills 组件。通过执行安全的只读系统命令,该技能可以收集 CPU 负载、内存利用率和磁盘空间等关键性能数据,而无需安装侵入性代理或修改系统配置。它是原始 Linux 指标与 AI 驱动的自动化工作流之间的可靠桥梁。

该技能内置了弹性机制,包含回退方案以确保在受限环境中也能持续收集数据。无论您是管理单台 VPS 还是服务器集群,该工具都能提供主动维护和性能优化所需的结构化数据,并集成在 Openclaw Skills 框架内。

下载入口:https://github.com/openclaw/skills/tree/main/skills/sanjay-gthb/server-health-agent

安装与下载

1. ClawHub CLI

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

npx clawhub@latest install server-health-agent

2. 手动安装

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

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

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

3. 提示词安装

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

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

服务器健康代理 应用场景

  • 实时监控 VPS 性能。
  • 通过 DevOps 工作流自动执行基础设施健康检查。
  • 排除突发的性能瓶颈或资源激增故障。
  • 跟踪磁盘空间使用情况以防止因存储引起的停机。
  • 在容器化环境中审计 Docker 容器状态。
服务器健康代理 工作原理
  1. 该技能通过使用 Openclaw Skills 架构的代理工作流触发。
  2. 它执行 top 或 df 等 shell 命令来收集原始硬件利用率数据。
  3. 对于容器监控,它尝试与 Docker 套接字接口以列出活跃容器。
  4. Node.js 逻辑将原始输出处理成清晰的解析格式,如果标准命令失败,则采用回退计算。
  5. 该技能返回一个包含服务器生命体征的结构化 JSON 负载,供 AI 代理分析或执行操作。

服务器健康代理 配置指南

要将其集成到您的环境中,请确保已安装适当的运行时。使用以下命令将其添加到您的 Openclaw Skills 库中:

openclaw install server-health-agent

确保执行环境具有访问 shell 的权限,并根据需要提供访问 Docker 套接字的权限,以实现容器监控功能。

服务器健康代理 数据架构与分类体系

该技能输出一个结构化的 JSON 对象。以下是响应的元数据分类:

字段 类型 描述
success boolean 指示健康检查是否成功完成
skill string 技能标识符 (server-health-agent)
timestamp ISO8601 捕获指标的确切时间
server_health.cpu_percent string 当前 CPU 使用百分比
server_health.ram_percent string 当前内存利用率百分比
server_health.disk_usage string 根分区已使用的磁盘空间百分比
server_health.docker_status string 运行中的容器状态或访问受限通知
name: server-health-agent
description: Monitor VPS and server health metrics including real-time CPU usage, RAM utilization, disk usage, and Docker container status. Useful for DevOps monitoring, troubleshooting performance issues, and infrastructure health checks.
runtime: node
entry: skill.js
permissions:
  - shell

Server Health Agent

Server Health Agent is a production-ready OpenClaw skill designed to provide real-time monitoring of key server health metrics. It helps developers, DevOps engineers, and system administrators quickly assess the operational health of their VPS or server.

This skill executes safe system-level read-only commands to collect accurate health metrics without modifying the system.


Key Features

Real-Time CPU Monitoring

Uses live system commands (top) to capture current CPU utilization, with fallback mechanisms to ensure reliability even in restricted environments.

Memory (RAM) Monitoring

Reports accurate RAM usage percentage using system-level commands and Node.js fallback logic.

Disk Usage Monitoring

Provides root filesystem disk utilization, allowing detection of storage pressure or capacity issues.

Docker Container Detection

Detects and reports running Docker containers and their status when Docker socket access is available.

Gracefully handles environments where Docker access is restricted.

Structured Output

Returns structured JSON output optimized for OpenClaw automation workflows and downstream processing.


Use Cases

This skill is useful for:

  • VPS health monitoring
  • DevOps automation workflows
  • Infrastructure monitoring
  • Troubleshooting performance issues
  • Detecting resource bottlenecks
  • Monitoring containerized environments
  • Automated system health checks

Example Output

{
  "success": true,
  "skill": "server-health-agent",
  "timestamp": "2026-02-20T12:00:00Z",
  "server_health": {
    "cpu_percent": "12.44",
    "ram_percent": "21.33",
    "disk_usage": "51%",
    "docker_status": "openclaw-openclaw-gateway-1: Up 2 hours"
  }
}