mxschmitt / fritzbox_exporter

Prometheus Exporter for FRITZ!Box (TR64 and UPnP)
https://mxschmitt.github.io/fritzbox_exporter
Apache License 2.0
58 stars 17 forks source link

set env variables #18

Closed GM-Ant closed 4 years ago

GM-Ant commented 4 years ago

Hi, thanks for the great work!!

My Fritz!Box is however not reachable on its default address so it would be very practical if the next values could be set through docker "ENV" variables:

    flag.StringVar(&settings.FritzBox.IP, "gateway-address", "fritz.box", "The hostname or IP of the FRITZ!Box")
    flag.IntVar(&settings.FritzBox.Port, "gateway-port", 49000, "The port of the FRITZ!Box UPnP service")
    flag.StringVar(&settings.FritzBox.UserName, "username", "", "The user for the FRITZ!Box UPnP service")
    flag.StringVar(&settings.FritzBox.Password, "password", "", "The password for the FRITZ!Box UPnP service")
ilmanzo commented 4 years ago

I understand it's already possible to pass config via ENV ?

https://github.com/mxschmitt/fritzbox_exporter/blob/master/cmd/exporter/exporter.go#L341

mxschmitt commented 4 years ago

Good point, yep indeed. It should.