Skip to main content
Glama

system-status

Hermes スタイルの運用エージェント: Ubuntu / Docker / パブリック IP を監視し、アラートを飞书へプッシュします。

機能

  • 🐳 Docker 監視:コンテナ状態、再起動回数、CPU/メモリ、ヘルスチェック

  • 🖥️ システム監視:CPU、メモリ、ディスク、ロード

  • 🌐 パブリック IP ドリフト検出:複数のソースで検証し、変化時にアラート

  • 💬 飞书アラート:リッチテキストカード + @指定ユーザー

  • 📊 SQLite 履歴データ:サンプリングごとにDBへ保存し、デフォルトで7日間保持

  • ️ Web パネル:リアルタイムダッシュボード + トレンドグラフ + アラートストリーム

    • ブラウザで http://localhost:8080/web/ を開くだけでOKです。

  • 🌐 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?inutes=60

    • GET /api/history/ip

    • GET /api/alarts/recent

    • GET /mcp/tops

Related MCP server: 6amdev-server-mcp

クイックスタート

1. 飞书 ロボットを作成

グループチャット → 設定 → グループボット → 追加 → カスタムボット → Webhook と Secret を取得します。

2. 環境変数の設定

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

3. 起動

docker compose up -d

4. 検証

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

設定説明

.env:

変数

必須

説明

FEISHU_WEBHOOK

✅

飞书 ロボット Webhook

FEISHU_SECRET

⭕

署名検証キー

FEISHU_AT_MOBILES

⭕

@する電話番号、カンマ区切り

FEISHU_AT_ALL

⭕

全員に@するかどうか

CHECK_INTERVAL

⭕

チェック間隔(秒)、デフォルト 60

HTTP_PORT

⭕

HTTP ポート、デフォルト 8080

Hermes への連携

Hermes は HTTP MCP を経由してこれらのエンドポイントを直接呼び出すことができます。 Hermes の設定に次を追加します:

mcp_servers:
  - name: system-status
    type: http
    base_url: http://localhost:8080
    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 にコミットしないでください。

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    F
    maintenance
    Multi-machine system monitor with a built-in MCP server that enables AI agents to query health metrics, manage processes, schedule cron jobs, and run diagnostics across local and remote machines.
    133 npm
    Apache 2.0
  • A
    license
    B
    quality
    D
    maintenance
    MCP server for managing Ubuntu servers with AI integration, enabling system monitoring, Docker control, Gitea repository management, Ollama LLM interaction, workspace file operations, and Claude Code assistant via natural language.
    34
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Official Hyperping MCP server for uptime, API, cron and server monitoring. 26 tools covering monitors, outages and timelines, uptime, response time, MTTR and MTTA, on-call schedules and escalation policies, over a remote Streamable HTTP endpoint with Bearer token auth and no install.
    1
    MIT