Skip to content

A docker container with collectd preconfigured to fetch data from a FritzBox

Notifications You must be signed in to change notification settings

marcogracklauer/docker-collectd-fritzbox

 
 

Repository files navigation

Docker container with collectd configured to collect data from Fritzbox

This docker container is a preconfigured collectd with installed fritzcollectd. I use it on my Synology DS218+ to gather longterm connection statistics of my Fritzbox.

Setup

  • Install docker
  • Clone this repository to your machine
git clone https://github.com/marcogracklauer/docker-collectd-fritzbox
  • Build a local Docker image
docker build -t fritzbox-collectd:latest .
  • Create a user in Fritzbox used by collectd so that the TR-069 interface can be queried:
Now create a user account in the Fritz!Box for collectd. Go to System, Fritz!Box-user and create a new user with password, who has access from internet disabled. The important part is to enable „Fritz!Box settings“.

Additionally make sure that your Fritz!Box is configured to support connection queries using UPnP. You can configure this under „Home Network > Network > Networksettings“. Select „Allow access for applications“ as well as „Statusinformation using UPnP“.

Usage

Start the container manually:

Be aware that this will leave your used credentials in your bash history! It might be better to use the docker-compose version.

docker run -d -e EP_HOST=example.com -e EP_PORT=2003 -e FRITZ_IP=192.168.178.1 -e FRITZ_PASSWORD=<yourpassword> fritzbox-collectd

Start the container using the docker-compose.yml:

  • Modify the environment variables in docker-compose.ymlaccording to your setup
  • Rename or copy collectd.env.template to collectd.env and fill it according to your setup
docker-compose up
  • collectd will now be available on your host in the exposed port 25826.

If you want to run the container permamently, you'll need to use the -d option:

docker-compose -f docker-compose.yml up -d

Config influxdb

Add the settings from influxdb.conf to your local config.

  • Create the database collectd in your Influxdb

Mapping of collectd values to influxdb using types.db

You've might wonder about the types.db. It is taken from the collectd installation and must be present for influxdb, so that influx knows how it should map the values from collectd.

  • Copy that file to your environment running the influxdb.

Credits

Parts of the config is taken from collectd-docker.

License

The MIT License (MIT)

Copyright (c) 2019 Markus Rudel

About

A docker container with collectd preconfigured to fetch data from a FritzBox

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Smarty 42.1%
  • Dockerfile 35.0%
  • Shell 22.9%