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 <noreply@anthropic.com>
This commit is contained in:
Mikkel Georgsen 2026-01-14 23:04:51 +00:00
parent 980475e903
commit 172087b463
4 changed files with 14 additions and 17 deletions

View file

@ -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/<token>?status=up&msg=OK&ping=50"
~/bin/kuma list # List all monitors
~/bin/kuma info <id> # Show monitor details
~/bin/kuma add-http <name> <url> # Add HTTP monitor
~/bin/kuma add-port <name> <host> <port> # Add TCP port monitor
~/bin/kuma add-ping <name> <host> # Add ping monitor
~/bin/kuma delete <id> # Delete monitor
~/bin/kuma pause <id> # Pause monitor
~/bin/kuma resume <id> # Resume monitor
```
Note: Full monitor management (add/edit/delete) requires Socket.IO API, not REST.
## Common SSH Targets
```bash

View file

@ -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

View file

@ -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/<token>` - Push monitor updates
- `/api/status-page/<slug>` - Status page data
- `/api/badge/<id>/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)

View file

@ -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'