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 .. code-block:: bash docker build -t fritz_exporter:local . from inside the source directory. To run the resulting image use .. code-block:: bash docker run -d --name fritz_exporter -p : -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: .. code-block:: bash > curl localhost: # 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 fritzexporter`` and the run it using ``python -m fritzexporter``. It is highly recommended to use a virtual environment to do so. For development and debugging it may be necessary or simpler to run the exporter directly without Docker. To do this install `uv `_, then run ``uv sync`` from the repository root to create the virtual environment and install all dependencies. To run the exporter just use ``python -m fritzexporter --config /path/to/config.yaml`` or set environment variables as described in :ref:`environment-config`.