OA0 = Omni AI 0
OA0 是一个探索 AI 的论坛
现在注册
已注册用户请  登录
OA0  ›  技能包  ›  uptime-kuma: 与 Uptime Kuma 服务健康监控服务器实时交互

uptime-kuma: 与 Uptime Kuma 服务健康监控服务器实时交互

 
  skills ·  2026-02-02 12:19:20 · 3 次点击  · 0 条评论  

名称: uptime-kuma
描述: 与 Uptime Kuma 监控服务器交互。用于检查监控器状态、添加/删除监控器、暂停/恢复检查、查看心跳历史。触发关键词:Uptime Kuma、服务器监控、在线率检查、服务健康监控。


Uptime Kuma 技能

通过封装 Socket.IO API 的 CLI 工具管理 Uptime Kuma 监控器。

环境配置

需要安装 uptime-kuma-api Python 包:

pip install uptime-kuma-api

环境变量(在 shell 或 Clawdbot 配置中设置):
- UPTIME_KUMA_URL - 服务器地址(例如 http://localhost:3001
- UPTIME_KUMA_USERNAME - 登录用户名
- UPTIME_KUMA_PASSWORD - 登录密码

使用说明

脚本位置:scripts/kuma.py

命令列表

# 整体状态概览
python scripts/kuma.py status

# 列出所有监控器
python scripts/kuma.py list
python scripts/kuma.py list --json

# 获取监控器详情
python scripts/kuma.py get <id>

# 添加监控器
python scripts/kuma.py add --name "我的网站" --type http --url https://example.com
python scripts/kuma.py add --name "服务器Ping" --type ping --hostname 192.168.1.1
python scripts/kuma.py add --name "SSH端口" --type port --hostname server.local --port 22

# 暂停/恢复监控器
python scripts/kuma.py pause <id>
python scripts/kuma.py resume <id>

# 删除监控器
python scripts/kuma.py delete <id>

# 查看心跳历史
python scripts/kuma.py heartbeats <id> --hours 24

# 列出通知渠道
python scripts/kuma.py notifications

监控器类型

  • http - HTTP/HTTPS 端点检查
  • ping - ICMP Ping 检查
  • port - TCP 端口检查
  • keyword - HTTP + 关键词搜索
  • dns - DNS 解析检查
  • docker - Docker 容器检查
  • push - 推送式(被动)监控
  • mysql, postgres, mongodb, redis - 数据库检查
  • mqtt - MQTT 代理检查
  • group - 监控器分组

常用工作流

检查故障服务:

python scripts/kuma.py status
python scripts/kuma.py list  # 查找 🔴 标记项

添加30秒间隔的HTTP监控器:

python scripts/kuma.py add --name "API健康检查" --type http --url https://api.example.com/health --interval 30

维护模式(暂停所有监控):

for id in $(python scripts/kuma.py list --json | jq -r '.[].id'); do
  python scripts/kuma.py pause $id
done
3 次点击  ∙  0 人收藏  
登录后收藏  
目前尚无回复
0 条回复
About   ·   Help   ·    
OA0 - Omni AI 0 一个探索 AI 的社区
沪ICP备2024103595号-2
Developed with Cursor