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 pingport- 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
文章底部电脑广告
手机广告位-内容正文底部


微信扫一扫,打赏作者吧~