Browse Source

Improves readme

- add toc
- updates build instructions
- fixed some typos
pull/1/head
Christian Fritz 5 years ago
parent
commit
1c12a42754
No known key found for this signature in database GPG Key ID: AB40486FCA9FA29C
  1. 140
      README.md

140
README.md

@ -1,81 +1,119 @@
# Fritz!Box Upnp statistics exporter for prometheus # Fritz!Box Upnp statistics exporter for prometheus
This exporter exports some variables from an This exporter exports some variables from an
[AVM Fritzbox](http://avm.de/produkte/fritzbox/) [AVM Fritzbox](http://avm.de/produkte/fritzbox/) to prometheus.
to prometheus.
This exporter is tested with a Fritzbox 7590 software version 07.12 and 07.20. This exporter is tested with a Fritzbox 7590 software version 07.12 and
07.20.
The goal of the fork is: The goal of the fork is:
- [x] allow passing of username / password using evironment variable - [x] allow passing of username / password using environment variable
- [x] use https instead of http for communitcation with fritz.box - [x] use https instead of http for communication with fritz.box
- [x] move config of metrics to be exported to config file rather then code - [x] move config of metrics to be exported to config file rather then
- [x] add config for additional metrics to collect (especially from TR-064 API) code
- [x] create a grafana dashboard consuming the additional metrics - [x] add a configuration for additional metrics to collect (especially
from TR-064 API)
- [x] create a grafana dashboard consuming the additional metrics
- [x] add a docker build
- [x] exposes health check endpoints
Other changes: Other changes:
- replaced digest authentication code with own implementation - replaced digest authentication code with own implementation
- improved error messages - improved error messages
- **New:** test mode prints details about all SOAP Actions and their parameters - **New:** test mode prints details about all SOAP Actions and their
- **New:** collect option to directly test collection of results parameters
- **New:** additional metrics to collect details about connected hosts and DECT devices - **New:** collect option to directly test collection of results
- **New:** support to use results like hostname or MAC address as labels to metrics - **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
[TOC]: # "## Table of Contents"
## Table of Contents
- [Building](#building)
- [Running](#running)
- [Exported metrics](#exported-metrics)
- [Output of `-test`](#output-of--test)
- [Customizing metrics](#customizing-metrics)
- [Grafana Dashboard](#grafana-dashboard)
## Building ## Building
go get github.com/sberk42/fritzbox_exporter/ ```shell script
cd $GOPATH/src/github.com/sberk42/fritzbox_exporter git clone https://github.com/chr-fritz/fritzbox_exporter.git
go install cd fritzbox_exporter
go mod download
go build
```
## Running ## Running
In the configuration of the Fritzbox the option "Statusinformationen über UPnP übertragen" in the dialog "Heimnetz > In the configuration of the Fritzbox the option `Statusinformationen
Heimnetzübersicht > Netzwerkeinstellungen" has to be enabled. über UPnP übertragen` in the dialog `Heimnetz > Heimnetzübersicht >
Netzwerkeinstellungen` has to be enabled.
Usage: Usage:
$GOPATH/bin/fritzbox_exporter -h ```
Usage of ./fritzbox_exporter: $GOPATH/bin/fritzbox_exporter -h
-gateway-url string Usage of /fritzbox-exporter/fritzbox-exporter:
The URL of the FRITZ!Box (default "http://fritz.box:49000") -collect=false:
-listen-address string print configured metrics to stdout and exit
The address to listen on for HTTP requests. (default "127.0.0.1:9042") -gateway-url="http://fritz.box:49000":
-metrics-file string The URL of the FRITZ!Box
The JSON file with the metric definitions. (default "metrics.json") -json-out="":
-password string store metrics also to JSON file when running test
The password for the FRITZ!Box UPnP service -listen-address="127.0.0.1:9042":
-test The address to listen on for HTTP requests.
print all available SOAP calls and their results (if call possible) to stdout -metrics-file="metrics.json":
-collect The JSON file with the metric definitions.
collect metrics once print to stdout and exit -password="":
-json-out string The password for the FRITZ!Box UPnP service
store metrics also to JSON file when running test -test=false:
-username string print all available metrics to stdout
The user for the FRITZ!Box UPnP service -username="":
The user for the FRITZ!Box UPnP service
The password (needed for metrics from TR-064 API) can be passed over environment variables to test in shell: -verifyTls=false:
read -rs PASSWORD && export PASSWORD && ./fritzbox_exporter -username <user> -test; unset PASSWORD Verify the tls connection when connecting to the FRITZ!Box
```
The password can be passed over environment variables to test in shell:
```shell script
read -rs PASSWORD && export PASSWORD && ./fritzbox_exporter -username <user> -test; unset PASSWORD
```
## Exported metrics ## Exported metrics
start exporter and run Start the exporter and run:
```shell script
curl -s http://127.0.0.1:9042/metrics curl -s http://127.0.0.1:9042/metrics
```
## Output of -test ## Output of `-test`
The exporter prints all available Variables to stdout when called with the -test option. The exporter prints all available Variables to `stdout` when called with
These values are determined by parsing all services from http://fritz.box:49000/igddesc.xml and http://fritzbox:49000/tr64desc.xml (for TR64 username and password is needed!!!) the `-test` option. It retrieves these values by parsing all services
from <http://fritz.box:49000/igddesc.xml> and
<http://fritzbox:49000/tr64desc.xml>. To access TR64 the exporter needs
username and password.
## Customizing metrics ## 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
For a list of all the available metrics just execute the exporter with -test (username and password are needed for the TR-064 API!) the [`metrics.json`](metrics.json) file, so just adjust to your needs.
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 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): 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 7590 v7.12](all_available_metrics_7590_7.12.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.20](all_available_metrics_7590_7.20.json)
## Grafana Dashboard ## Grafana Dashboard
The dashboard is now also published on [Grafana](https://grafana.com/grafana/dashboards/12579). The dashboard is now also published on
[Grafana](https://grafana.com/grafana/dashboards/12579).

Loading…
Cancel
Save