网淘吧来吧,欢迎您!

Uptime Kuma技能使用说明

2026-03-28 新闻来源:网淘吧 围观:22
电脑广告
手机广告

Uptime Kuma 技能

通过围绕 Socket.IO API 的 CLI 包装器管理 Uptime Kuma 监控器。

设置

要求uptime-kuma-apiPython 包:

pip install uptime-kuma-api

环境变量(在 shell 或 Clawdbot 配置中设置):

  • UPTIME_KUMA_URL- 服务器 URL(例如,http://localhost:3001
  • UPTIME_KUMA_USERNAME- 登录用户名
  • UPTIME_KUMA_PASSWORD- 登录密码

用法

脚本位置:scripts/kuma.py

命令

# Overall status summary
python scripts/kuma.py status

# List all monitors
python scripts/kuma.py list
python scripts/kuma.py list --json

# Get monitor details
python scripts/kuma.py get <id>

# Add monitors
python scripts/kuma.py add --name "My Site" --type http --url https://example.com
python scripts/kuma.py add --name "Server Ping" --type ping --hostname 192.168.1.1
python scripts/kuma.py add --name "SSH Port" --type port --hostname server.local --port 22

# Pause/resume monitors
python scripts/kuma.py pause <id>
python scripts/kuma.py resume <id>

# Delete monitor
python scripts/kuma.py delete <id>

# View heartbeat history
python scripts/kuma.py heartbeats <id> --hours 24

# List notification channels
python scripts/kuma.py notifications

监控器类型

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

常见工作流程

检查宕机项目:

python scripts/kuma.py status
python scripts/kuma.py list  # Look for 🔴

添加30秒间隔的HTTP监控:

python scripts/kuma.py add --name "API Health" --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
免责申明
部分文章来自各大搜索引擎,如有侵权,请与我联系删除。
打赏
文章底部电脑广告
手机广告位-内容正文底部

相关文章

您是本站第326347名访客 今日有221篇新文章/评论