system-status

system-status

Enables monitoring of Ubuntu system metrics, Docker containers, and public IP drift, with Feishu alerting and HTTP/MCP tools for querying status, viewing history, and restarting containers.

Category
Visit Server

README

system-status

Hermes-style ops agent:监控 Ubuntu / Docker / 公网 IP,告警推飞书。

功能

  • 🐳 Docker 监控:容器状态、重启次数、CPU/内存、健康检查
  • 🖥️ 系统监控:CPU、内存、磁盘、负载
  • 🌐 公网 IP 漂移检测:多源校验,变化告警
  • 💬 飞书告警:富文本卡片 + @指定人
  • 📊 SQLite 历史数据:每次采样入库,默认保留 7 天
  • 🖼️ Web 面板:实时仪表盘 + 趋势图 + 告警流
    • 打开 http://localhost:8888/web/ 即可
  • 🌐 HTTP / MCP 接口:给 Hermes / 客户端调用
    • GET /health
    • GET /api/docker/containers
    • POST /api/docker/restart
    • GET /api/system
    • GET /api/ip
    • GET /api/dashboard
    • GET /api/history/system?minutes=60
    • GET /api/history/ip
    • GET /api/alerts/recent
    • GET /mcp/tools

快速开始

1. 创建飞书机器人

群聊 → 设置 → 群机器人 → 添加 → 自定义机器人 → 拿到 WebhookSecret

2. 配置环境变量

cp .env.example .env
# 编辑 .env,填入飞书 webhook 和 secret

3. 启动

docker compose up -d

4. 验证

curl http://localhost:8888/health
curl http://localhost:8888/api/docker/containers
curl http://localhost:8888/api/system
curl http://localhost:8888/api/ip

配置说明

.env:

变量 必填 说明
FEISHU_WEBHOOK 飞书机器人 Webhook
FEISHU_SECRET 签名校验密钥
FEISHU_AT_MOBILES @ 的手机号,逗号分隔
FEISHU_AT_ALL 是否 @所有人
CHECK_INTERVAL 检查间隔(秒),默认 60
HTTP_PORT HTTP 端口,默认 8888(避开 cadence-rocky:final 已用的 8080)

接入 Hermes

Hermes 可以直接通过 HTTP MCP 调这些端点。 在 Hermes 配置里加:

mcp_servers:
  - name: system-status
    type: http
    base_url: http://localhost:8888
    tools:
      - name: list_containers
        method: GET
        path: /api/docker/containers
      - name: system_health
        method: GET
        path: /api/system
      - name: check_public_ip
        method: GET
        path: /api/ip
      - name: restart_container
        method: POST
        path: /api/docker/restart
        body_schema:
          type: object
          properties:
            name: { type: string }

然后你可以对 Hermes 说:

"列出所有退出的容器" "重启 mysql-01" "现在的公网 IP 是什么?" "系统健康度怎么样?"

项目结构

system-status/
├── src/
│   ├── index.ts            # 入口
│   ├── config.ts           # 配置加载
│   ├── mcp/server.ts       # HTTP / MCP 接口
│   ├── monitor/
│   │   ├── docker.ts       # Docker 监控
│   │   ├── system.ts       # 系统监控
│   │   ├── ip.ts           # 公网 IP 检测
│   │   └── loop.ts         # 监控主循环
│   └── alert/
│       ├── feishu.ts       # 飞书 Webhook + 签名
│       └── templates.ts    # 告警模板
├── config/rules.yaml       # 告警规则
├── Dockerfile
├── docker-compose.yml
└── .env.example

告警冷却

同类告警默认 5 分钟 内不重复推(避免告警风暴)。 可在 src/monitor/loop.ts 调整 COOLDOWN_MS

安全提示

  • ⚠️ docker.sock 等于 root 权限,务必只读 :ro
  • ⚠️ 容器开了 privileged: true,生产环境请评估风险
  • ⚠️ 飞书 Webhook 不要提交到 Git

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured