Docker image for Network UPS Tools server v2.7.4.
This image provides a complete UPS monitoring service (USB driver only).
Start directly the container:
# Example
docker run \
--name nut-upsd \
--network host \
-v nut_data:/nut \
--env UPS_NAME="ups" \
--env UPS_DESC="eaton570i" \
--env UPS_DRIVER="usbhid-ups" \
--env UPS_PORT="auto" \
--env API_USER="upsmon" \
--env API_PASSWORD="secret" \
--env ADMIN_USER="admin" \
--env ADMIN_PASSWORD="adminSecret" \
--env SHUTDOWN_CMD="my-shutdown-command-from-container" \
--device /dev/bus/usb/001/001 \
--restart unless-stopped \
--detach \
viktorfreire/nut-upsdStart the container using Docker Compose
#Example
version: "3.4"
services:
nut-upsd:
container_name: nut-upsd
pull_policy: always
image: viktorfreire/nut-upsd
network_mode: "host"
volumes:
- nut_data:/nut
environment:
- UPS_NAME="ups"
- UPS_DESC="eaton570i"
- UPS_DRIVER="usbhid-ups"
- UPS_PORT="auto"
- API_USER="upsmon"
- API_PASSWORD="secret"
- ADMIN_USER="admin"
- ADMIN_PASSWORD="adminSecret"
- SHUTDOWN_CMD="my-shutdown-command-from-container"
devices:
- /dev/bus/usb/001/001
restart: unless-stoppedWithing the latest updates was introduced the possibility to use dedicated volume instead of using the OS directories, with this I make it possible to have persistante data.
This image supports total customization via environment variables.
Default value: ups
The name of the UPS.
Default value: eaton570i
This allows you to set a brief description that upsd will provide to clients that ask for a list of connected equipment.
Default value: usbhid-ups
This specifies which program will be monitoring this UPS.
Default vaue: auto
This is the serial port where the UPS is connected.
Default vaue: upsmon
This is the username used for communication between upsmon and upsd processes.
Default vaue: secret
This is the password for the upsmon user.
Default vaue: admin
This is the username used for administration.
Default vaue: adminSecret
This is the password for the admin user.
Default vaue: runs an script that shutdown the server where NUT is running
This is the command upsmon will run when the system needs to be brought down. The command will be run from inside the container. It's possible to provide the location of the script that it's intended to be executed when the UPS is running low battery lvl, for that the script need to be stored in the /nut/scripts/ folder.