All apps · 0 apps
apcupsd-influxdb-exporter
Docker app from atribe's Repository
Overview
Readme
View on GitHubapcupsd-influxdb-exporter
Dockerized Python script that will send data from apcupsd to influxdb.
How to build
Building the image is straight forward:
- Git clone this repo
docker build -t apcupsd-influxdb-exporter .
Environment Variables
These are all the available environment variables, along with some example values, and a description.
| Environment Varialbe | Example Value | Description |
|---|---|---|
| WATTS | 1000 | 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 | 192.168.1.100 | host running apcupsd, defaults to the value of influxdb_host |
| INFLUXDB_HOST | 192.168.1.101 | host running influxdb |
| HOSTNAME | unraid | host you want to show up in influxdb. Optional, defaults to apcupsd hostname value |
| 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 |
| INTERVAL | 10 | optional, defaults to 10 seconds |
| VERBOSE | true | if anything but true docker logging will show no output |
How to Use
Run docker container directly
docker run --rm -d --name="apcupsd-influxdb-exporter" \
-e "WATTS=600" \
-e "INFLUXDB_HOST=10.0.1.11" \
-e "APCUPSD_HOST=10.0.1.11" \
-t atribe/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'
services:
apcupsd-influxdb-exporter:
image: atribe/apcupsd-influxdb-exporter
container_name: apcupsd-influxdb-exporter
restart: always
environment:
WATTS: 1000
APCUPSD_HOST: 10.0.1.11
INFLUXDB_HOST: 10.0.1.11
INTERVAL: 5
If you want to debug the apcaccess output or the send to influxdb, set the environment variable "VERBOSE" to "true"
Install apcupsd-influxdb-exporter on Unraid in a few clicks.
Find apcupsd-influxdb-exporter in Community Apps on your Unraid server, review the template, and click Install. Unraid handles the Docker app or plugin setup from the published template.
Categories
Download Statistics
Total Downloads Over Time
Related apps
Explore more like this
Explore allLinks
Details
atribe/apcupsd-influxdb-exporterRuntime arguments
- Network
bridge- Shell
sh- Privileged
- false
Template configuration
host you want the measurements to show up as in influxdb
- Default
- unraid
- Value
- panthro
If your UPS doesn't have the NOMPOWER metric then specify the rated watts so that the load percentage can be used to calculate the current watts
- Value
- 1500
ip address of influxdb
- Default
- localhost
- Value
- 10.13.13.15
address of host running apcupsd
- Default
- localhost
- Value
- 10.13.13.15
Container Variable: INFLUXDB_PORT
- Default
- 8086
- Value
- 8086
influxdb database name to store values
- Default
- apcupsd
- Value
- apcupsd
User name for Influxdb
Password for Influxdb
Set this variable to true to see the output in the docker log.
- Target
- VERBOSE
- Default
- false
- Value
- false