-
Notifications
You must be signed in to change notification settings - Fork 0
docker
system2mqtt can be run in a Docker container. The Docker image is primarily designed for Proxmox API monitoring — it does not have access to the host's hardware sensors, so bare-metal CPU/memory monitoring is not available in a standard Docker deployment.
Note: The Docker image is available on Docker Hub as
optimusgreen/system2mqtt.
mkdir -p ~/system2mqtt/dataCopy the Docker-specific example:
cp docker/s2m.conf ~/system2mqtt/data/s2m.confOr create a new one:
cat > ~/system2mqtt/data/s2m.conf << 'EOF'
COMPUTER_NAME=MyPveNode
MQTT_HOST=192.168.1.100
#MQTT_USER=myuser
#MQTT_PASSWORD=mypassword
PVE_SYSTEM=True
PVE_HOST=192.168.1.50
PVE_NODE_NAME=pve
PVE_USER=root@pam
PVE_PASSWORD=mysecretpassword
HA_DISCOVERY=True
EOFversion: "2"
services:
system2mqtt:
image: optimusgreen/system2mqtt:latest
container_name: system2mqtt
restart: unless-stopped
volumes:
- ./data:/configdocker-compose up -ddocker-compose logs -fThe container expects your s2m.conf to be placed in the /config volume. The container runs:
python3 /system2mqtt/run.py /config/s2m.confAny changes to s2m.conf require a container restart to take effect:
docker-compose restartIf you want to build the image yourself from the included Dockerfile:
cd docker
docker build -t my-system2mqtt .Then update your docker-compose.yaml to use the local image:
services:
system2mqtt:
image: my-system2mqtt
...The standard Docker image does not support bare-metal system monitoring because:
- It cannot access the host's
/sys/class/thermalfor CPU temperature. - It cannot access the host's disks via
psutilinside the container.
If you specifically need to monitor the Docker host machine:
- Run system2mqtt directly on the host instead (see Getting Started).
- Or, use
--privilegedmode and mount host filesystems — this is an advanced configuration not officially supported.
Pull the latest image and recreate the container:
docker-compose pull
docker-compose up -d