Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Dockerfile #1

Open
wants to merge 153 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
e2d5bbf
Remove unneeded build arguments
dotWee Feb 15, 2021
009e3fc
Simplify environment variable declarations
dotWee Feb 15, 2021
9e1b95b
Allow LISTEN_ADDRESS environment variable
dotWee Feb 15, 2021
238b68f
Define ENTRYPOINT according to exec format
dotWee Feb 15, 2021
0d2642e
Add CMD tag for simplified execution
dotWee Feb 15, 2021
15f05f7
Add docker-compose.yml
dotWee Feb 15, 2021
6986685
Add docs for running using docker/docker-compose
dotWee Feb 15, 2021
306716b
Add comment regarding "no such host" issues when using docker-compose
dotWee Feb 26, 2021
74e9d4e
Add comment regarding "no such host" issues when using `docker run`
dotWee Feb 26, 2021
66406b9
added dslforum max bit rate to handle different results with 5.29
sberk42 Mar 27, 2021
25f17b7
fix lua not collected after fritzbox restart
sberk42 Mar 27, 2021
5530549
added WLAN status to metrics
sberk42 Apr 1, 2021
4d5b0d2
added 7.25 metrics and updated docu a bit
sberk42 Apr 1, 2021
d9031e6
Adds go.mod file to use go modules while building.
chr-fritz Oct 10, 2020
282fbbb
Add additional flag to control the verification of tls connections.
chr-fritz Oct 10, 2020
91bbea2
Adds readiness and liveness endpoints.
chr-fritz Oct 10, 2020
8976ed2
Uses logrus instead printf for logging and fixes creating error messa…
chr-fritz Oct 24, 2020
709549c
Merge branch 'Alexxanddr:master' into master
dotWee Jul 16, 2021
3fc0587
added go.mod and go.sum
sberk42 Nov 14, 2021
908555c
Merge branch 'master' into go-modules
sberk42 Jan 9, 2022
4b1c30a
Merge pull request #6 from chr-fritz/go-modules
sberk42 Jan 9, 2022
a44494f
Merge pull request #9 from chr-fritz/logrus-logging
sberk42 Jan 9, 2022
aa0e20c
Merge branch 'master' into verfiy-tls
sberk42 Jan 9, 2022
24d9f42
Merge pull request #7 from chr-fritz/verfiy-tls
sberk42 Jan 9, 2022
61030f7
Merge branch 'master' into health-checks
sberk42 Jan 9, 2022
7ba6f29
Merge pull request #8 from chr-fritz/health-checks
sberk42 Jan 9, 2022
6acb836
Merge pull request #5 from dotWee/master
sberk42 Jan 9, 2022
e7427e8
rebuild after merge
sberk42 Jan 9, 2022
7c0048a
cleanup \n
sberk42 Jan 9, 2022
baa6961
added json for v7.29 (identical to 7.25)
sberk42 Jan 9, 2022
83f5dbf
fix for values containing not only numbers
sberk42 Feb 14, 2022
c765ded
fix issue with negative LUA metrics and added cable samples
sberk42 Feb 14, 2022
3b9f170
Update Dockerfile and let exporter run as non-root user
paulbruedgam Feb 15, 2022
8289d3c
Building container with github actions
paulbruedgam Feb 15, 2022
f545e6e
Remove unnecessary parts
paulbruedgam Feb 15, 2022
290828f
Rename Dockerfile in pipeline to fit this project
paulbruedgam Feb 15, 2022
117cc98
Fix Hadolint DL3025: Use arguments JSON notation for CMD and ENTRYPOI…
paulbruedgam Feb 15, 2022
96f0e30
Ensure workdir exists
paulbruedgam Feb 15, 2022
38b7f1b
Map groupadd and useradd to alpine ones
paulbruedgam Feb 15, 2022
8253f1b
Rename Job because we don't build in different job stages
paulbruedgam Feb 15, 2022
8e8cd8a
Name runtime image
paulbruedgam Feb 15, 2022
9e60f6c
Correct entrypoint
paulbruedgam Feb 15, 2022
3f21bcd
Running ENTRYPOINT in a Shell
paulbruedgam Feb 15, 2022
c3c3ac8
Merge pull request #11 from paulbruedgam/master
sberk42 Feb 18, 2022
79dfd3e
update build instructions to no longer use go get
sberk42 Apr 7, 2022
6b8ced0
switched to use go install
sberk42 Apr 9, 2022
60bf13c
GitHub Action for weekly builds
dotWee May 21, 2022
0451a7a
Lets test arm v6
dotWee May 21, 2022
a947af2
Tell Dependabot to monitor docker & GitHub action dependencies
dotWee May 21, 2022
f40981e
Bump docker/build-push-action from 2.10.0 to 3.0.0
dependabot[bot] May 21, 2022
f3c822b
Merge pull request #1 from dotWee/dependabot/github_actions/docker/bu…
dotWee May 21, 2022
b598173
GitHub Action for weekly builds
dotWee May 21, 2022
caf5010
Lets test arm v6
dotWee May 21, 2022
22f6726
Tell Dependabot to monitor docker & GitHub action dependencies
dotWee May 21, 2022
4a3eaae
Bump docker/build-push-action from 2.10.0 to 3.0.0
dependabot[bot] May 21, 2022
ddb8cc5
Merge remote-tracking branch 'origin/master'
dotWee May 21, 2022
117c0bd
Bump alpine from 3.15 to 3.16.0
dependabot[bot] May 30, 2022
2afe615
Merge pull request #2 from dotWee/dependabot/docker/alpine-3.16.0
dotWee Jun 5, 2022
c97020e
Bump sigstore/cosign-installer from 2.3.0 to 2.4.0
dependabot[bot] Jun 13, 2022
ca3b6fe
Merge pull request #3 from dotWee/dependabot/github_actions/sigstore/…
dotWee Jun 13, 2022
0a55bb2
Bump sigstore/cosign-installer from 2.4.0 to 2.4.1
dependabot[bot] Jul 4, 2022
5cdd1ac
Bump docker/build-push-action from 3.0.0 to 3.1.0
dependabot[bot] Jul 25, 2022
b70af5e
Bump alpine from 3.16.0 to 3.16.1
dependabot[bot] Jul 25, 2022
303cc5c
Merge pull request #4 from dotWee/dependabot/github_actions/sigstore/…
dotWee Jul 31, 2022
e3f265a
Merge pull request #5 from dotWee/dependabot/github_actions/docker/bu…
dotWee Jul 31, 2022
53ac509
Merge pull request #6 from dotWee/dependabot/docker/alpine-3.16.1
dotWee Jul 31, 2022
5127d2b
Disable docker image signing until DockerHub's Keystore works
dotWee Jul 31, 2022
ca57132
Bump sigstore/cosign-installer from 2.4.1 to 2.5.0
dependabot[bot] Aug 1, 2022
76dae08
Merge pull request #7 from dotWee/dependabot/github_actions/sigstore/…
dotWee Aug 2, 2022
39f3a24
Bump docker/build-push-action from 3.1.0 to 3.1.1
dependabot[bot] Aug 8, 2022
70e5056
Bump alpine from 3.16.1 to 3.16.2
dependabot[bot] Aug 15, 2022
18c1668
Bump sigstore/cosign-installer from 2.5.0 to 2.5.1
dependabot[bot] Aug 22, 2022
41fa300
Merge pull request #9 from dotWee/dependabot/docker/alpine-3.16.2
dotWee Aug 24, 2022
75ede39
Merge pull request #8 from dotWee/dependabot/github_actions/docker/bu…
dotWee Aug 24, 2022
cefffc2
Merge pull request #10 from dotWee/dependabot/github_actions/sigstore…
dotWee Aug 24, 2022
0c586b5
Bump docker/setup-qemu-action from 2.0.0 to 2.1.0
dependabot[bot] Oct 17, 2022
f131964
Bump docker/build-push-action from 3.1.1 to 3.2.0
dependabot[bot] Oct 17, 2022
e968107
Bump sigstore/cosign-installer from 2.5.1 to 2.8.1
dependabot[bot] Oct 24, 2022
82d9a0a
Bump docker/metadata-action from 4.0.1 to 4.1.1
dependabot[bot] Oct 24, 2022
317d9ed
Bump alpine from 3.16.2 to 3.17.0
dependabot[bot] Nov 28, 2022
251c6d3
Merge pull request #15 from dotWee/dependabot/github_actions/docker/s…
dotWee Dec 1, 2022
44e7d2b
Bump docker/setup-buildx-action from 2.0.0 to 2.2.1
dependabot[bot] Dec 1, 2022
a0e3b6a
Merge pull request #22 from dotWee/dependabot/docker/alpine-3.17.0
dotWee Dec 1, 2022
c2c3c7a
Bump docker/login-action from 2.0.0 to 2.1.0
dependabot[bot] Dec 5, 2022
30f35b1
Merge pull request #23 from dotWee/dependabot/github_actions/docker/l…
dotWee Dec 14, 2022
c82b214
Merge pull request #20 from dotWee/dependabot/github_actions/docker/m…
dotWee Dec 18, 2022
2f4ba60
Merge pull request #19 from dotWee/dependabot/github_actions/sigstore…
dotWee Dec 18, 2022
456b00c
Merge pull request #18 from dotWee/dependabot/github_actions/docker/s…
dotWee Dec 18, 2022
0cb085e
Merge pull request #17 from dotWee/dependabot/github_actions/docker/b…
dotWee Dec 18, 2022
6e6472c
Bump alpine from 3.17.0 to 3.17.1
dependabot[bot] Jan 16, 2023
bd121b7
Bump docker/metadata-action from 4.1.1 to 4.3.0
dependabot[bot] Jan 16, 2023
13ac306
Bump docker/build-push-action from 3.2.0 to 3.3.0
dependabot[bot] Jan 16, 2023
9425401
Merge pull request #24 from dotWee/dependabot/docker/alpine-3.17.1
dotWee Jan 16, 2023
c5f4671
Merge pull request #25 from dotWee/dependabot/github_actions/docker/m…
dotWee Jan 16, 2023
fa7ef26
Merge pull request #26 from dotWee/dependabot/github_actions/docker/b…
dotWee Jan 16, 2023
7d24165
Bump docker/build-push-action from 3.3.0 to 4.0.0
dependabot[bot] Feb 6, 2023
ed4ca52
Bump docker/setup-buildx-action from 2.2.1 to 2.4.0
dependabot[bot] Feb 6, 2023
12e2f18
Merge pull request #29 from dotWee/dependabot/github_actions/docker/s…
dotWee Feb 6, 2023
c7a8139
Bump docker/setup-buildx-action from 2.4.0 to 2.5.0
dependabot[bot] Mar 13, 2023
1a7abe8
Bump alpine from 3.17.1 to 3.17.3
dependabot[bot] Apr 3, 2023
1a3d00c
Merge pull request #34 from dotWee/dependabot/docker/alpine-3.17.3
dotWee Apr 3, 2023
e02f014
Merge pull request #33 from dotWee/dependabot/github_actions/docker/s…
dotWee Apr 3, 2023
9ea8889
Bump sigstore/cosign-installer from 2.8.1 to 3.0.2
dependabot[bot] Apr 10, 2023
e109b52
Merge pull request #28 from dotWee/dependabot/github_actions/docker/b…
dotWee Apr 15, 2023
8ecd82f
Merge pull request #35 from dotWee/dependabot/github_actions/sigstore…
dotWee Apr 15, 2023
f264bf5
Bump docker/setup-qemu-action from 2.1.0 to 2.2.0
dependabot[bot] Jun 12, 2023
a747844
Bump docker/build-push-action from 4.0.0 to 4.1.1
dependabot[bot] Jun 19, 2023
f6f1235
Bump docker/metadata-action from 4.3.0 to 4.6.0
dependabot[bot] Jun 19, 2023
3ffa205
Bump sigstore/cosign-installer from 3.0.2 to 3.1.1
dependabot[bot] Jul 3, 2023
3495b0b
Bump docker/setup-buildx-action from 2.5.0 to 2.9.1
dependabot[bot] Jul 17, 2023
e224c34
Merge pull request #45 from dotWee/dependabot/github_actions/docker/m…
dotWee Aug 17, 2023
72a19b3
Bump alpine from 3.17.3 to 3.18.3
dependabot[bot] Aug 21, 2023
37da9cd
Bump docker/login-action from 2.1.0 to 2.2.0
dependabot[bot] Aug 21, 2023
e5a43f8
Merge pull request #42 from dotWee/dependabot/github_actions/docker/s…
dotWee Sep 2, 2023
cc904f9
Merge pull request #44 from dotWee/dependabot/github_actions/docker/b…
dotWee Sep 2, 2023
0afe6ba
Merge pull request #54 from dotWee/dependabot/github_actions/docker/l…
dotWee Sep 2, 2023
e8acc16
Merge pull request #50 from dotWee/dependabot/github_actions/sigstore…
dotWee Sep 2, 2023
21ee3da
Merge pull request #52 from dotWee/dependabot/github_actions/docker/s…
dotWee Sep 2, 2023
9c34746
Merge pull request #53 from dotWee/dependabot/docker/alpine-3.18.3
dotWee Sep 2, 2023
63d40b5
Bump sigstore/cosign-installer from 3.1.1 to 3.1.2
dependabot[bot] Sep 4, 2023
dd7b36d
Bump docker/setup-buildx-action from 2.9.1 to 2.10.0
dependabot[bot] Sep 4, 2023
5a24b0e
Bump actions/checkout from 3 to 4
dependabot[bot] Sep 11, 2023
6fca650
Bump docker/build-push-action from 4.1.1 to 4.2.1
dependabot[bot] Sep 11, 2023
d639f44
Merge pull request #55 from dotWee/dependabot/github_actions/sigstore…
dotWee Sep 15, 2023
4a95b4d
Merge pull request #58 from dotWee/dependabot/github_actions/docker/b…
dotWee Sep 15, 2023
51b5a07
Merge pull request #57 from dotWee/dependabot/github_actions/actions/…
dotWee Sep 15, 2023
a1a04d1
Merge pull request #56 from dotWee/dependabot/github_actions/docker/s…
dotWee Sep 15, 2023
7402318
Bump docker/setup-qemu-action from 2.2.0 to 3.0.0
dependabot[bot] Sep 18, 2023
bd0ff73
Bump docker/setup-buildx-action from 2.10.0 to 3.0.0
dependabot[bot] Sep 18, 2023
c772662
Bump docker/login-action from 2.2.0 to 3.0.0
dependabot[bot] Sep 18, 2023
3c00370
Merge pull request #63 from dotWee/dependabot/github_actions/docker/l…
dotWee Oct 7, 2023
c89dbb0
Bump docker/build-push-action from 4.2.1 to 5.1.0
dependabot[bot] Nov 20, 2023
81f26ed
Bump alpine from 3.18.3 to 3.19.1
dependabot[bot] Jan 29, 2024
47e704b
Bump sigstore/cosign-installer from 3.1.2 to 3.4.0
dependabot[bot] Feb 5, 2024
2514221
Bump docker/metadata-action from 4.6.0 to 5.5.1
dependabot[bot] Feb 5, 2024
082c7df
Merge pull request #59 from dotWee/dependabot/github_actions/docker/s…
dotWee Oct 7, 2024
35e9ed3
Merge pull request #61 from dotWee/dependabot/github_actions/docker/s…
dotWee Oct 7, 2024
6baf1a4
Merge pull request #66 from dotWee/dependabot/github_actions/docker/b…
dotWee Oct 7, 2024
56f5794
Merge pull request #74 from dotWee/dependabot/docker/alpine-3.19.1
dotWee Oct 7, 2024
068f83a
Merge pull request #75 from dotWee/dependabot/github_actions/sigstore…
dotWee Oct 7, 2024
a7f2fc5
Merge pull request #76 from dotWee/dependabot/github_actions/docker/m…
dotWee Oct 7, 2024
be0c37d
Bump docker/setup-buildx-action from 3.0.0 to 3.7.1
dependabot[bot] Oct 14, 2024
470695f
Bump docker/login-action from 3.0.0 to 3.3.0
dependabot[bot] Oct 14, 2024
cf07ed9
Bump sigstore/cosign-installer from 3.4.0 to 3.7.0
dependabot[bot] Oct 14, 2024
daa331b
Bump docker/build-push-action from 5.1.0 to 6.9.0
dependabot[bot] Oct 14, 2024
4043b36
Bump docker/setup-qemu-action from 3.0.0 to 3.2.0
dependabot[bot] Oct 14, 2024
066d226
Bump alpine from 3.19.1 to 3.20.3
dependabot[bot] Oct 14, 2024
270ef41
Merge pull request #82 from dotWee/dependabot/docker/alpine-3.20.3
dotWee Oct 21, 2024
5c4deca
Merge pull request #81 from dotWee/dependabot/github_actions/docker/s…
dotWee Oct 21, 2024
70679d9
Merge pull request #80 from dotWee/dependabot/github_actions/docker/b…
dotWee Oct 21, 2024
48e8078
Merge pull request #79 from dotWee/dependabot/github_actions/sigstore…
dotWee Oct 21, 2024
eea2bd3
Merge pull request #78 from dotWee/dependabot/github_actions/docker/l…
dotWee Oct 21, 2024
b319ab1
Merge pull request #77 from dotWee/dependabot/github_actions/docker/s…
dotWee Oct 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .github/.DS_Store
Binary file not shown.
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

# Enable version updates for Docker
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
97 changes: 97 additions & 0 deletions .github/workflows/docker-build-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: build & publish docker image

on:
push:
schedule:
# every sunday at midnight
- cron: '0 0 * * 0'
workflow_dispatch:

env:
IMAGE_NAME: dotwee/fritzbox-prometheus-exporter

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer
- name: Install cosign
uses: sigstore/[email protected]
with:
cosign-release: 'v1.6.0'

- name: Setup QEMU binaries
uses: docker/[email protected]

- name: Setup Docker buildx
uses: docker/[email protected]
with:
buildkitd-flags: --debug

- name: Log into Docker Hub
uses: docker/[email protected]
with:
username: dotwee
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}

- name: Log into GitHub registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/[email protected]
with:
images: |
${{ env.IMAGE_NAME }}
ghcr.io/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
flavor: |
latest=true

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/[email protected]
with:
build-args: REPO=${{ github.repository }}
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

# // SET IMAGE SIGNING ON ICE UNTIL DOCKERHUB'S KEYSTORE GETS FIXED //
# Sign the resulting Docker image digest except on PRs.
# This will only write to the public Rekor transparency log when the Docker
# repository is public to avoid leaking data. If you would like to publish
# transparency data even for private images, pass --force to cosign below.
# https://github.com/sigstore/cosign
# - name: Sign the published Docker image
# env:
# COSIGN_EXPERIMENTAL: "true"
# # This step uses the identity token to provision an ephemeral certificate
# # against the sigstore community Fulcio instance.
# run: cosign sign ${{ env.IMAGE_NAME }}@${{ steps.build-and-push.outputs.digest }}
48 changes: 36 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,37 @@
FROM golang:rc-alpine3.13 AS builder
RUN go get github.com/sberk42/fritzbox_exporter/

FROM alpine:latest
ARG USERNAME PASSWORD GWURL
ENV USERNAME ${USERNAME} && \
PASSWORD ${PASSWORD} && \
GWURL ${GWURL}
WORKDIR /root/
COPY --from=builder /go/bin/fritzbox_exporter .
COPY metrics.json metrics-lua.json ./
# syntax=docker/dockerfile:1

# Build Image
FROM golang:alpine3.15 AS builder
RUN go install github.com/sberk42/fritzbox_exporter@latest \
&& mkdir /app \
&& mv /go/bin/fritzbox_exporter /app

WORKDIR /app

COPY metrics.json metrics-lua.json /app/

# Runtime Image
FROM alpine:3.20.3 as runtime-image

ARG REPO=sberk42/fritzbox_exporter

LABEL org.opencontainers.image.source https://github.com/${REPO}

ENV USERNAME username
ENV PASSWORD password
ENV GATEWAY_URL http://fritz.box:49000
ENV LISTEN_ADDRESS 0.0.0.0:9042

RUN mkdir /app \
&& addgroup -S -g 1000 fritzbox \
&& adduser -S -u 1000 -G fritzbox fritzbox \
&& chown -R fritzbox:fritzbox /app

WORKDIR /app

COPY --chown=fritzbox:fritzbox --from=builder /app /app

EXPOSE 9042
ENTRYPOINT ./fritzbox_exporter -gateway-url ${GWURL} -password ${PASSWORD} -username ${USERNAME} -listen-address 0.0.0.0:9042

ENTRYPOINT [ "sh", "-c", "/app/fritzbox_exporter" ]
CMD [ "-username", "${USERNAME}", "-password", "${PASSWORD}", "-gateway-url", "${GATEWAY_URL}", "-listen-address", "${LISTEN_ADDRESS}" ]
74 changes: 57 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This exporter exports some variables from an
[AVM Fritzbox](http://avm.de/produkte/fritzbox/)
to prometheus.

This exporter is tested with a Fritzbox 7590 software version 07.12, 07.20 and 07.21.
This exporter is tested with a Fritzbox 7590 software version 07.12, 07.20, 07.21 and 07.25.

The goal of the fork is:
- [x] allow passing of username / password using evironment variable
Expand All @@ -17,46 +17,83 @@ The goal of the fork is:
Other changes:
- replaced digest authentication code with own implementation
- improved error messages
- **New:** test mode prints details about all SOAP Actions and their parameters
- **New:** collect option to directly test collection of results
- **New:** additional metrics to collect details about connected hosts and DECT devices
- **New:** support to use results like hostname or MAC address as labels to metrics
- **New:** support for metrics from lua APIs (e.g. CPU temperature, utilization, ...)
- test mode prints details about all SOAP Actions and their parameters
- collect option to directly test collection of results
- additional metrics to collect details about connected hosts and DECT devices
- support to use results like hostname or MAC address as labels to metrics
- support for metrics from lua APIs (e.g. CPU temperature, utilization, ...)


## Building

go get github.com/sberk42/fritzbox_exporter/
cd $GOPATH/src/github.com/sberk42/fritzbox_exporter
go install
go install github.com/sberk42/fritzbox_exporter@latest

## Running

In the configuration of the Fritzbox the option "Statusinformationen über UPnP übertragen" in the dialog "Heimnetz >
Heimnetzübersicht > Netzwerkeinstellungen" has to be enabled.

### Using docker

First you have to build the container: `docker build --tag fritzbox-prometheus-exporter:latest .`

Then start the container:

```bash
$ docker run -e 'USERNAME=your_fritzbox_username' \
-e 'PASSWORD=your_fritzbox_password' \
-e 'GATEWAY_URL="http://192.168.0.1:49000"' \
-e 'LISTEN_ADDRESS="0.0.0.0:9042"' \
fritzbox-prometheus-exporter:latest
```

I've you're getting `no such host` issues, define your FritzBox as DNS server for your docker container like this:

```bash
$ docker run --dns YOUR_FRITZBOX_IP \
-e 'USERNAME=your_fritzbox_username' \
-e 'PASSWORD=your_fritzbox_password' \
-e 'GATEWAY_URL="http://192.168.0.1:49000"' \
-e 'LISTEN_ADDRESS="0.0.0.0:9042"' \
fritzbox-prometheus-exporter:latest
```

### Using docker-compose

Set your environment variables within the [docker-compose.yml](docker-compose.yml) file.

Then start up the container using `docker-compose up -d`.

### Using the binary

Usage:

$GOPATH/bin/fritzbox_exporter -h
Usage of ./fritzbox_exporter:
-gateway-url string
The URL of the FRITZ!Box (default "http://fritz.box:49000")
-listen-address string
The address to listen on for HTTP requests. (default "127.0.0.1:9042")
-gateway-luaurl string
The URL of the FRITZ!Box UI (default "http://fritz.box")
-metrics-file string
The JSON file with the metric definitions. (default "metrics.json")
-password string
The password for the FRITZ!Box UPnP service
-lua-metrics-file string
The JSON file with the lua metric definitions. (default "metrics-lua.json")
-test
print all available SOAP calls and their results (if call possible) to stdout
-json-out string
store metrics also to JSON file when running test
-testLua
read luaTest.json file make all contained calls and dump results
-collect
collect metrics once print to stdout and exit
-json-out string
store metrics also to JSON file when running test
-nolua
disable collecting lua metrics
-username string
The user for the FRITZ!Box UPnP service
-password string
The password for the FRITZ!Box UPnP service
-listen-address string
The address to listen on for HTTP requests. (default "127.0.0.1:9042")

The password (needed for metrics from TR-064 API) can be passed over environment variables to test in shell:
read -rs PASSWORD && export PASSWORD && ./fritzbox_exporter -username <user> -test; unset PASSWORD
Expand All @@ -73,13 +110,16 @@ These values are determined by parsing all services from http://fritz.box:49000/

## Customizing metrics

The metrics to collect are no longer hard coded, but have been moved to the [metrics.json](metrics.json) file, so just adjust to your needs.
The metrics to collect are no longer hard coded, but have been moved to the [metrics.json](metrics.json) and [metrics-lua.json](metrics-lua.json) files, so just adjust to your needs (for cable version also see [metrics-lua_cable.json](metrics-lua_cable.json)).
For a list of all the available metrics just execute the exporter with -test (username and password are needed for the TR-064 API!)
For lua metrics open UI in browser and check the json files used for the various screens.

For a list of all available metrics, see the dumps below (the format is the same as in the metrics.json file, so it can be used to easily add further metrics to retrieve):
- [FritzBox 6591 v7.29](all_available_metrics_6591_7.29.json)
- [FritzBox 7590 v7.12](all_available_metrics_7590_7.12.json)
- [FritzBox 7590 v7.20](all_available_metrics_7590_7.20.json)

- [FritzBox 7590 v7.25](all_available_metrics_7590_7.25.json)
- [FritzBox 7590 v7.29](all_available_metrics_7590_7.29.json)
## Grafana Dashboard

The dashboard is now also published on [Grafana](https://grafana.com/grafana/dashboards/12579).
Loading