Skip to content
Docker-based APCUPSd daemon that sends UPS-device information to InfluxDB.
Python Dockerfile
Branch: master
Clone or download
Latest commit e8e911d Mar 5, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
img first commit Mar 31, 2018
.travis.yml adding travis CI integration Jul 8, 2018
Dockerfile rebase Feb 27, 2019 adding apcupsd-tcp docs Mar 2, 2019 adding kubernetes docs Mar 2, 2019
docker-compose.yml updating docs. adding docker-compose Feb 27, 2019
vals.env.sample Update vals.env.sample Mar 5, 2019


Build an x86_64 or ARM compatible Docker image that will output commonly used UPS device statistics to an influxdb database using an included version of the APCUPSd tool. Dockerfiles included for both intel and ARM (RaspberryPi or comparable) chipsets.

How to build

Building the image is straight forward:

  • Git clone this repo
  • docker build -t bgulla/apcupsd-influxdb-exporter .

Environment Variables

These are all the available environment variables, along with some example values, and a description.

Environment Variable Example Value Description
WATTS 1500 if your ups doesn't have NOMPOWER, set this to be the rated max power, if you do have NOMPOWER, don't set this variable
APCUPSD_HOST host running apcupsd
INFLUXDB_HOST host running influxdb
HOSTNAME unraid host you want to show up in influxdb, optional defaults to apcupsd-influxdb-exporter
INFLUXDB_DATABASE apcupsd db name for influxdb. optional, defaults to apcupsd
INFLUXDB_USER myuser optional, defaults to empty
INFLUXDB_PASSWORD pass optional, defaults to empty
INFLUXDB_PORT 8086 optional, defaults to 8086
VERBOSE true if anything but true docker logging will show no output
UPS_ALIAS server_closet an additional influxdb tag to the influxdb output

How to Use


This docker image assumes that you already have an instance of apcupsd running. If you want to deploy one via docker, run the following:

docker run -ti --rm \
    --name="apcupsd-tcp" \
    -p 3551:3551 \
    --privileged \

Run docker container directly

docker run --rm  -d --name="apcupsd-influxdb-exporter" \
    -e "WATTS=600" \
    -e "HOSTNAME=unraid" \
    -e "INFLUXDB_HOST=" \
    -e "APCUPSD_HOST=" \
    -t bgulla/apcupsd-influxdb-exporter

Note: if your UPS does not include the NOMPOWER metric, you will need to include the WATTS environment variable in order to compute the live-power consumption metric.

Run from docker-compose

version: '3'
    image: bgulla/apcupsd-influxdb-exporter
    container_name: apcupsd-influxdb-exporter
    restart: always
      WATTS: 1500
      HOSTNAME: unraid

If you want to debug the apcaccess output or the send to influxdb, set the environment variable "VERBOSE" to "true"


apiVersion: apps/v1beta2
kind: Deployment
  name: ups-apcupsd-tcp
  namespace: default
      app: ups-monitor
        app: ups-monitor
      - image: bgulla/apcupsd-tcp
        imagePullPolicy: Always
        name: ups-apcupsd-tcp
        - containerPort: 3551
          name: 3551tcp02
          protocol: TCP
        resources: {}
          capabilities: {}
          privileged: true
      - env:
        - name: APCUPSD_HOST
          value: localhost
        - name: INFLUXDB_DATABASE
          value: power
        - name: INFLUXDB_HOST
          value: influxdb-homelab.influxdb.svc.cluster.local # service that routes to influxdb (port 8086 default)
        - name: UPS_ALIAS
          value: addl_servers
        - name: VERBOSE
          value: "true"
        image: bgulla/apcupsd-influxdb-exporter
        imagePullPolicy: Always
        name: apcupsd-influx-exporter
      dnsPolicy: ClusterFirst
      nodeName: node01		# Node that the UPS is connected to
      restartPolicy: Always
You can’t perform that action at this time.