How henrygd/beszel works
Beszel pairs a per-host agent with a PocketBase-based hub and dashboard. The main workflow is agent collection of host, container, storage, and network-monitoring metrics; delivery to the hub over WebSocket or SSH; system management and persistence; then dashboard visualization and alerting. The README documents capabilities such as multi-user/OAuth, backups, and API access that are not fully evidenced in sampled source. Connections reflect explicit README statements or the SOURCE INDEX; unsampled subsystem wiring is not asserted.
Main entry points: system_manager.go System manager · router.tsx Dashboard routes · server.go Hub server · connection_manager.go Agent connection
Components 24
Host agent
- Metric collection
agent - Storage pools
agent/storage_pool.go - Agent connection
agent/connection_manager.go - SSH responder
agent/server.go - WebSocket client
agent/client.go - Network monitoring
agent/network_monitor.go
Hub services
- Hub server
internal/hub/server.go - System manager
internal/hub/systems/system_manager.go - WebSocket requests
internal/hub/ws/request_manager.go - Agent transport
internal/hub/transport - API and access
internal/hub/api.go - MCP tools
internal/hub/mcp - Network monitor data
internal/entities/monitor/monitor.go
Persistence
- Record processing
internal/records/records.go - PocketBase store
Web dashboard
- Dashboard routes
internal/site/src/components/router.tsx - System client state
internal/site/src/lib/systemsManager.ts - System data hook
internal/site/src/components/routes/system/use-system-data.ts - Metric charts
internal/site/src/components/routes/system/chart-data.ts - Pool charts and table
internal/site/src/components/routes/system/storage-pools-table.tsx
Alerts and integrations
- Alert evaluation
internal/alerts - Notifications
internal/alerts/notification_client.go
Other components
- Operator
- Notification services
Connections 23
- Operator → Dashboard routes: uses dashboard
- Dashboard routes → System client state: routes systems
- Dashboard routes → Hub server: loads dashboard
- Metric collection → Storage pools: collects pools
agent/storage_pool.go - Agent connection → WebSocket client: connects WebSocket
agent/connection_manager.go - Agent connection → SSH responder: starts fallback
agent/connection_manager.go - WebSocket client → WebSocket requests: exchanges requests
- SSH responder → Agent transport: serves SSH
- Network monitoring → System manager: reports monitoring
- Hub server → System manager: manages systems
- System manager → WebSocket requests: dispatches requests
internal/hub/systems/system_manager.go - System manager → PocketBase store: reads records
- System manager → Record processing: feeds metrics
- Record processing → PocketBase store: stores aggregates
- API and access → PocketBase store: serves API data
- MCP tools → API and access: exposes tools
- System client state → Hub server: fetches system state
- System data hook → Metric charts: prepares chart data
internal/site/src/components/routes/system/use-system-data.ts - System data hook → Pool charts and table: supplies pool data
- Alert evaluation → Notifications: sends notifications
internal/alerts/notification_client.go - Notifications → Notification services: delivers alerts
internal/alerts/notification_client.go - System manager → Alert evaluation: evaluates system alerts
- System manager → Network monitor data: tracks monitors
internal/hub/systems/system_manager.go