From 172087b463b7be5e24a6cbcc333be8126900036d Mon Sep 17 00:00:00 2001 From: Mikkel Georgsen Date: Wed, 14 Jan 2026 23:04:51 +0000 Subject: [PATCH] Add Uptime Kuma helper script and monitors - Created ~/bin/kuma for managing monitors via Socket.IO API - Uses uptime-kuma-api Python library - Added monitors: PBS, Forgejo, Technitium DNS - Updated credentials with username/password for Socket.IO auth Co-Authored-By: Claude Opus 4.5 --- CLAUDE.md | 19 +++++++++---------- README.md | 1 + homelab-documentation.md | 9 ++------- uptime-kuma/credentials | 2 ++ 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 3303e5f..6deeb74 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -80,19 +80,18 @@ The `~/bin/dns` script manages Technitium DNS (internal zone: lab.georgsen.dk): ## Uptime Kuma API Access -Uptime Kuma (status.georgsen.dk) has limited REST API - mainly for metrics and push monitors. - +The `~/bin/kuma` script manages Uptime Kuma monitors: ```bash -# Get Prometheus metrics -source ~/.config/uptime-kuma/credentials -curl -u ":$KUMA_API_KEY" "http://$KUMA_HOST:$KUMA_PORT/metrics" - -# Push monitor update (for passive checks) -curl "http://$KUMA_HOST:$KUMA_PORT/api/push/?status=up&msg=OK&ping=50" +~/bin/kuma list # List all monitors +~/bin/kuma info # Show monitor details +~/bin/kuma add-http # Add HTTP monitor +~/bin/kuma add-port # Add TCP port monitor +~/bin/kuma add-ping # Add ping monitor +~/bin/kuma delete # Delete monitor +~/bin/kuma pause # Pause monitor +~/bin/kuma resume # Resume monitor ``` -Note: Full monitor management (add/edit/delete) requires Socket.IO API, not REST. - ## Common SSH Targets ```bash diff --git a/README.md b/README.md index 804a0c7..2634acb 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ Helper scripts available: - `~/bin/pve` - Proxmox VE API - `~/bin/npm-api` - Nginx Proxy Manager API - `~/bin/dns` - Technitium DNS API +- `~/bin/kuma` - Uptime Kuma monitoring API ## Quick Links diff --git a/homelab-documentation.md b/homelab-documentation.md index 729ffb7..e187ec7 100644 --- a/homelab-documentation.md +++ b/homelab-documentation.md @@ -599,13 +599,8 @@ Personal company website - **Host:** 10.5.0.10:3001 (on Dockge container) - **URL:** https://status.georgsen.dk - **Config:** ~/homelab/uptime-kuma/credentials (symlinked to ~/.config/uptime-kuma) -- **API Key:** uk1_... (stored in credentials file) -- **REST Endpoints:** - - `/metrics` - Prometheus metrics (auth: Basic with API key as password) - - `/api/push/` - Push monitor updates - - `/api/status-page/` - Status page data - - `/api/badge//status` - Status badges -- **Note:** Full monitor management requires Socket.IO API, not REST +- **Helper:** ~/bin/kuma (list, info, add-http, add-port, add-ping, delete, pause, resume) +- **Library:** uptime-kuma-api (Python, installed in ~/venv) ### PVE API (from mgmt container) diff --git a/uptime-kuma/credentials b/uptime-kuma/credentials index 530da99..323c5c8 100644 --- a/uptime-kuma/credentials +++ b/uptime-kuma/credentials @@ -1,3 +1,5 @@ KUMA_HOST=10.5.0.10 KUMA_PORT=3001 KUMA_API_KEY=uk1_Vuph7SHROz7iagvmjz2Vb5z1Bn3PwZS6z2PGqd9i +KUMA_USER=mikkel +KUMA_PASS='Wa;dbqBCA-^Bc7n'