| name | power-sentry-deploy-control-panel |
| description | Deploy the PowerSentry control panel (WebSocket server + web UI) on a server like dk1. Use when asked to set up the central dashboard, WebSocket server, or monitoring UI. |
PowerSentry Deploy — Control Panel (UI Daemon)
Overview
Deploys the PowerSentry control panel on a server (e.g., dk1). The control panel includes:
- WebSocket Server (
:8765): Receives real-time metrics from worker agents
- HTTP Server (
:8080): Serves the web dashboard and REST API
- Central Database (SQLite): Stores all worker data
- Web UI (Vue 3 + Tailwind + DaisyUI): Real-time dashboard
Prerequisites
- SSH access to the target server (e.g., dk1@92.113.145.178)
- SSH key for the target server
- Python 3 on the target
- WebSocket port
:8765 and HTTP port :8080 must be open/forwarded
.env Configuration
DK1_HOST=<control-panel-ip>
DK1_USER=<ssh-username>
Deployment Steps
1. Run deploy-control-panel script
cd proxmox-power-monitor
./deploy-control-panel.sh <control-panel-host>
The script will:
- Load
.env if present
- Check connectivity to the target
- Verify Python 3 availability
- Install
websockets Python package
- Create remote directories
- Copy
control-panel/server/server.py to the target
- Copy
control-panel/ui/index.html to the target
- Create a systemd user service (
powersency-control-panel)
- Reload systemd and enable the service
2. SSH into the control panel server
ssh <user>@<control-panel-host>
3. Start the control panel
systemctl --user start powersency-control-panel
systemctl --user status powersency-control-panel
4. Access the web UI
Open http://<control-panel-host>:8080 in a browser.
Service Management
systemctl --user status powersency-control-panel
journalctl -u powersency-control-panel -f
systemctl --user restart powersency-control-panel
systemctl --user stop powersency-control-panel
Connecting Workers
Once the control panel is running, workers can connect by specifying the WebSocket URL:
python3 cli.py install --control-panel=ws://<control-panel-host>:8765/worker
python3 cli.py start
Troubleshooting
Web UI not accessible:
netstat -tlnp | grep 8080
journalctl -u powersency-control-panel -f
Workers not connecting:
netstat -tlnp | grep 8765
wscat -c ws://<control-panel>:8765/worker
iptables -L
Ports not accessible:
- Ensure ports
8080 and 8765 are open in any firewall
- For cloud VMs, check security group/network ACL rules
- Use SSH port forwarding for testing:
ssh -L 8080:localhost:8080 <user>@<host>