From 654e3ffbcef73a3afd4ef3beb15dbf74885392d7 Mon Sep 17 00:00:00 2001 From: Mikkel Georgsen Date: Wed, 14 Jan 2026 23:27:01 +0000 Subject: [PATCH] Add Beszel server monitoring dashboard - Deployed Beszel hub in Dockge (10.5.0.10:8090) - Installed agents on PVE host and PBS (with Synology mount monitoring) - Created NPM proxy at dashboard.georgsen.dk - Created ~/bin/beszel helper script for API management - Added credentials for Beszel and Dockge - Updated all documentation Co-Authored-By: Claude Opus 4.5 --- CLAUDE.md | 12 +++++ README.md | 2 + beszel/README.md | 101 +++++++++++++++++++++++++++++++++++++++ beszel/credentials | 6 +++ dockge/credentials | 4 ++ homelab-documentation.md | 23 +++++++++ 6 files changed, 148 insertions(+) create mode 100644 beszel/README.md create mode 100644 beszel/credentials create mode 100644 dockge/credentials diff --git a/CLAUDE.md b/CLAUDE.md index 6deeb74..76bc675 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -78,6 +78,18 @@ The `~/bin/dns` script manages Technitium DNS (internal zone: lab.georgsen.dk): ~/bin/dns lookup # Query DNS ``` +## Beszel Dashboard Access + +The `~/bin/beszel` script manages the server monitoring dashboard: +```bash +~/bin/beszel list # List all systems +~/bin/beszel status # Show system metrics (CPU, RAM, disk) +~/bin/beszel add [port] # Add a system +~/bin/beszel delete # Delete a system +``` + +Dashboard URL: https://dashboard.georgsen.dk + ## Uptime Kuma API Access The `~/bin/kuma` script manages Uptime Kuma monitors: diff --git a/README.md b/README.md index 2634acb..6839c13 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ Helper scripts available: - `~/bin/npm-api` - Nginx Proxy Manager API - `~/bin/dns` - Technitium DNS API - `~/bin/kuma` - Uptime Kuma monitoring API +- `~/bin/beszel` - Beszel server dashboard API ## Quick Links @@ -49,3 +50,4 @@ Helper scripts available: | NPM Admin | http://10.5.0.1:81 | | Dockge | https://dockge.georgsen.dk | | PBS | https://pbs.georgsen.dk | +| Dashboard | https://dashboard.georgsen.dk | diff --git a/beszel/README.md b/beszel/README.md new file mode 100644 index 0000000..977f220 --- /dev/null +++ b/beszel/README.md @@ -0,0 +1,101 @@ +# Beszel - Server Monitoring Dashboard + +## Overview + +- **Hub URL:** https://dashboard.georgsen.dk (or http://10.5.0.10:8090) +- **Credentials:** `~/.config/beszel/credentials` +- **Backend:** PocketBase (REST API) +- **Retention:** 30 days (automatic averaging) + +## Architecture + +``` +Hub (Dockge 10.5.0.10:8090) + ├── core (10.5.0.254:45876) - PVE host + └── pbs (10.5.0.6:45876) - Backup server + Synology mount +``` + +## Helper Script + +```bash +~/bin/beszel list # List all systems +~/bin/beszel status # Show system metrics +~/bin/beszel add [port] # Add a system +~/bin/beszel delete # Delete a system +~/bin/beszel alerts # List alerts +``` + +## Adding a New System + +### 1. Install Agent + +```bash +# Download binary +curl -sL "https://github.com/henrygd/beszel/releases/latest/download/beszel-agent_linux_amd64.tar.gz" | tar -xzf - -C /usr/local/bin beszel-agent +chmod +x /usr/local/bin/beszel-agent + +# Create systemd service +cat > /etc/systemd/system/beszel-agent.service << 'EOF' +[Unit] +Description=Beszel Agent +After=network.target + +[Service] +Environment="KEY=" +Environment="PORT=45876" +ExecStart=/usr/local/bin/beszel-agent +Restart=always +RestartSec=5 + +[Install] +WantedBy=multi-user.target +EOF + +# Enable and start +systemctl daemon-reload +systemctl enable beszel-agent +systemctl start beszel-agent +``` + +### 2. Add to Hub + +```bash +~/bin/beszel add +``` + +## Monitoring Extra Filesystems + +To monitor additional mounts (e.g., NFS, CIFS): + +```bash +# Add to systemd service +Environment="EXTRA_FILESYSTEMS=/mnt/synology,/mnt/other" +``` + +## API Access + +Beszel uses PocketBase. Python SDK: + +```python +from pocketbase import PocketBase + +pb = PocketBase('http://10.5.0.10:8090') +pb.admins.auth_with_password(email, password) + +# List systems +systems = pb.collection('systems').get_full_list() + +# Add system +pb.collection('systems').create({ + 'name': 'hostname', + 'host': '10.5.0.x', + 'port': 45876, + 'users': [user_id] +}) +``` + +## References + +- [Beszel GitHub](https://github.com/henrygd/beszel) +- [Beszel Docs](https://beszel.dev/) +- [PocketBase API](https://pocketbase.io/docs/api-records/) diff --git a/beszel/credentials b/beszel/credentials new file mode 100644 index 0000000..8d121cb --- /dev/null +++ b/beszel/credentials @@ -0,0 +1,6 @@ +BESZEL_HOST=10.5.0.10 +BESZEL_PORT=8090 +BESZEL_USER=msgeorgsen@gmail.com +BESZEL_PASS='&vtncQzmH^JI83lYi3Eo' +BESZEL_TOKEN=d1e-75b0375149-3117-6dc288f878 +BESZEL_AGENT_KEY='ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBG7SVFiCYNYBjFUK0cARP+dVmZHXkzeG4CUHbZUWaT8' diff --git a/dockge/credentials b/dockge/credentials new file mode 100644 index 0000000..65fddb6 --- /dev/null +++ b/dockge/credentials @@ -0,0 +1,4 @@ +DOCKGE_HOST=10.5.0.10 +DOCKGE_PORT=5001 +DOCKGE_USER=mikkel +DOCKGE_PASS='Pq=y]@i5uhJ4Far' diff --git a/homelab-documentation.md b/homelab-documentation.md index e187ec7..0c0b69d 100644 --- a/homelab-documentation.md +++ b/homelab-documentation.md @@ -183,6 +183,7 @@ cd /opt/npm && docker compose pull && docker compose up -d | pbs.georgsen.dk | https://10.5.0.6:8007 | Let's Encrypt | | status.georgsen.dk | http://10.5.0.10:3001 | Let's Encrypt | | webmail.georgsen.dk | http://10.5.0.10:8888 | Let's Encrypt | +| dashboard.georgsen.dk | http://10.5.0.10:8090 | Let's Encrypt | #### 101: Dockge @@ -213,6 +214,17 @@ services: - 3001:3001 volumes: - ./data:/app/data + +# Beszel (server monitoring dashboard) +services: + beszel: + image: henrygd/beszel:latest + container_name: beszel + restart: unless-stopped + ports: + - 8090:8090 + volumes: + - ./data:/beszel_data ``` #### 105: Sentry (Defense Intelligence) @@ -573,6 +585,7 @@ Personal company website | Status | https://status.georgsen.dk | | Webmail | https://webmail.georgsen.dk | | JukeBox | https://jukebox.georgsen.dk | +| Dashboard | https://dashboard.georgsen.dk or http://10.5.0.10:8090 | ### Important IPs @@ -602,6 +615,16 @@ Personal company website - **Helper:** ~/bin/kuma (list, info, add-http, add-port, add-ping, delete, pause, resume) - **Library:** uptime-kuma-api (Python, installed in ~/venv) +### Beszel Dashboard API (from mgmt container) + +- **Host:** 10.5.0.10:8090 (Docker in Dockge) +- **URL:** https://dashboard.georgsen.dk +- **Config:** ~/homelab/beszel/credentials (symlinked to ~/.config/beszel) +- **Helper:** ~/bin/beszel (list, status, add, delete, alerts) +- **Library:** pocketbase (Python, installed in ~/venv) +- **Retention:** 30 days (automatic) +- **Agents:** core (10.5.0.254), pbs (10.5.0.6) + ### PVE API (from mgmt container) - **Token:** root@pam!mgmt