360 Secure SkillHub
360 安全技能中心

Uptime Kuma

封装 Uptime Kuma Socket.IO API 的 Python CLI:查看监控状态与心跳历史、列出/新增/删除监控项、暂停或恢复检查,支持 JSON 输出;依赖 uptime-kuma-api 包及 UPTIME_KUMA_URL/USERNAME/PASSWORD 环境变量连接自建服务。

msarheed
msarheed
热度 98.67
最近更新 2026-05-17 11:03:50
分类:自动化依赖:代码执行 / 第三方 API应用场景:DevOps / 自动化脚本 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add uptime-kuma
Metadata
name
uptime-kuma
description
Interact with Uptime Kuma monitoring server. Use for checking monitor status, adding/removing monitors, pausing/resuming checks, viewing heartbeat history. Triggers on mentions of Uptime Kuma, server monitoring, uptime checks, or service health monitoring.

Uptime Kuma Skill

Manage Uptime Kuma monitors via CLI wrapper around the Socket.IO API.

Setup

Requires uptime-kuma-api Python package:

pip install uptime-kuma-api

Environment variables (set in shell or Clawdbot config):

  • UPTIME_KUMA_URL - Server URL (e.g., http://localhost:3001)
  • UPTIME_KUMA_USERNAME - Login username
  • UPTIME_KUMA_PASSWORD - Login password

Usage

Script location: scripts/kuma.py

Commands

# 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

Monitor Types

  • http - HTTP/HTTPS endpoint
  • ping - ICMP ping
  • port - TCP port check
  • keyword - HTTP + keyword search
  • dns - DNS resolution
  • docker - Docker container
  • push - Push-based (passive)
  • mysql, postgres, mongodb, redis - Database checks
  • mqtt - MQTT broker
  • group - Monitor group

Common Workflows

Check what's down:

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

Add HTTP monitor with 30s interval:

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

Maintenance mode (pause all):

for id in $(python scripts/kuma.py list --json | jq -r '.[].id'); do
  python scripts/kuma.py pause $id
done