Skip to content

Building

The recommended way to run this exporter is from a Docker container. The included Dockerfile builds the exporter using a Python:alpine base image and produces a clean, minimal runtime image.

Building and running from a local image

To build clone the repository from GitHub, enter the repository and execute

docker build -t fritz_exporter:local .

from inside the source directory.

To run the resulting image use

docker run -d --name fritz_exporter -p <PORT>:<FRITZ_EXPORTER_PORT> -e FRITZ_EXPORTER_CONFIG="192.168.178.1,username,password" fritz_exporter:local

Verify correct operation

To verify correct operation just use curl against the running exporter. It should reply with a Prometheus-style list of metrics:

> curl localhost:<FRITZ_EXPORTER_PORT>

# HELP python_gc_objects_collected_total Objects collected during gc
# TYPE python_gc_objects_collected_total counter
python_gc_objects_collected_total{generation="0"} 481.0
python_gc_objects_collected_total{generation="1"} 112.0
python_gc_objects_collected_total{generation="2"} 0.0
# HELP python_gc_objects_uncollectable_total Uncollectable object found during GC
# TYPE python_gc_objects_uncollectable_total counter
python_gc_objects_uncollectable_total{generation="0"} 0.0
python_gc_objects_uncollectable_total{generation="1"} 0.0
python_gc_objects_uncollectable_total{generation="2"} 0.0
...

Note

If you have the host_info config enabled for one or more devices please be aware, that it may take a long time to receive the reply, as the metrics are read sequentially when queried. Practical experience has shown that a device knowing around 70 WiFi devices may take 20-30s to reply to all metrics queries. So set appropriate timeouts.

Building and running locally (no containers)

You can install the latest release from PyPI using pip install fritz-exporter and then run it using python -m fritzexporter. It is highly recommended to use a virtual environment to do so.

For development and debugging, see Contributing for the local environment setup, verification commands, and how to run the exporter from source.