| name | power-sentry-deploy-proxmox |
| description | Deploy a PowerSentry worker agent daemon on a Proxmox host (or any target server), optionally via a jump/bastion host. Use when asked to deploy monitoring on a Proxmox server or any remote host behind a bastion. |
PowerSentry Deploy — Proxmox Worker Daemon
Overview
Deploys the PowerSentry worker agent (daemon + CLI) to a Proxmox host or any target server. Supports both direct connections and multi-hop SSH via a jump/bastion host.
Prerequisites
- SSH access to the target host (via jump host if needed)
- SSH key:
~/.ssh/id_ed25519 (or specify a different key in SSH_BASE)
- Python 3 on the target host
- The
.env file configured with your network specifics OR pass values as CLI args
.env Configuration
Create or update proxmox-power-monitor/.env:
PROXMOX_HOST=192.168.1.104
JUMP_HOST=100.86.93.41
JUMP_USER=ubuntu
REMOTE_USER=root
Deployment Steps
1. Copy .env from template (if not already done)
cd proxmox-power-monitor
cp .env.example .env
2. Run deploy script
With jump host (multi-hop):
cd proxmox-power-monitor
./deploy.sh <proxmox-host> <jump-host>
Direct connection (no jump host):
cd proxmox-power-monitor
./deploy.sh <target-ip>
The script will:
- Load
.env if present (values can be overridden by CLI args)
- Check connectivity (jump host if specified, then target)
- Verify Python 3 availability on target
- Install
websockets Python package
- Create remote directory structure (
/opt/proxmox-power-monitor)
- Copy all Python files to the target
- Set permissions
3. SSH into target and install the service
ssh -o IdentitiesOnly=yes -o IdentityFile=~/.ssh/id_ed25519 \
-J ubuntu@<jump-host> root@<proxmox-host>
ssh -o IdentitiesOnly=yes -o IdentityFile=~/.ssh/id_ed25519 root@<target-ip>
4. Install and start the worker
cd /opt/proxmox-power-monitor
python3 cli.py install
python3 cli.py install --control-panel=ws://<control-panel-host>:8765/worker
python3 cli.py start
python3 cli.py status
5. Verify metrics
python3 cli.py stats --total
python3 cli.py stats --recent=10
python3 cli.py project 14
What Gets Deployed
| File | Purpose |
|---|
daemon.py | Main metrics collection daemon |
cli.py | CLI for service management |
websocket_client.py | WebSocket client for control panel communication |
database.py | SQLite database management |
power.py | Power calculation model |
pricing.py | Electricity pricing |
metrics.py | System metrics collection |
Service Management
systemctl status powersentry-worker
journalctl -u powersentry-worker -f
cd /opt/proxmox-power-monitor
python3 cli.py uninstall
Troubleshooting
Connection refused to control panel:
- Verify control panel is running:
systemctl status powersency-control-panel
- Check network connectivity:
ping <control-panel-host>
- Test WebSocket:
wscat -c ws://<control-panel>:8765/worker
No metrics appearing:
- Check daemon logs:
journalctl -u powersentry-worker -f
- Verify database permissions:
ls -la /var/lib/proxmox-power-monitor/
- Restart daemon:
python3 cli.py restart
Deploy script fails:
- Verify jump host connectivity if using one
- Check SSH key permissions:
chmod 600 ~/.ssh/id_ed25519
- Ensure Python 3 is available on target:
which python3