Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/trazfr/freebox-exporter
Prometheus exporter for the Freebox
https://github.com/trazfr/freebox-exporter
freebox prometheus prometheus-exporter
Last synced: 3 months ago
JSON representation
Prometheus exporter for the Freebox
- Host: GitHub
- URL: https://github.com/trazfr/freebox-exporter
- Owner: trazfr
- License: mit
- Created: 2018-09-05T01:06:50.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-05-11T12:09:45.000Z (6 months ago)
- Last Synced: 2024-06-19T05:37:56.110Z (5 months ago)
- Topics: freebox, prometheus, prometheus-exporter
- Language: Go
- Homepage:
- Size: 94.7 KB
- Stars: 18
- Watchers: 5
- Forks: 7
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# freebox-exporter
Prometheus exporter for the [Freebox](https://www.free.fr/freebox/)
**Disclaimer**: I am not related to Iliad, Free or any of their subsidiaries. I have only created this Prometheus exporter to monitor my own device using some [publicly available documentation](https://dev.freebox.fr/sdk/os/).
## Install
### Since Golang 1.16
Having a working Golang >= 1.16 environment using Go modules:
```bash
go install github.com/trazfr/freebox-exporter@latest
```### Older Golang
This package requires at least Golang 1.13. For Golang 1.13:
```bash
GO111MODULE=on go get github.com/trazfr/freebox-exporter@latest
GO111MODULE=on go install github.com/trazfr/freebox-exporter
```## Use
This program is to be run in 2 steps, as you must authorize the exporter to access the Freebox. Once authorized, it may be run from anywhere.
```
Usage: freebox-exporter [options]api_token_file: file to store the token for the API
options:
-debug
enable the debug mode
-hostDetails
get details about the hosts connected to wifi and ethernet. This increases the number of metrics
-httpDiscovery
use http://mafreebox.freebox.fr/api_version to discover the Freebox at the first run (by default: use mDNS)
-listen string
listen to address (default ":9091")
```### Step 1 authorize API
From the Freebox network, generate a token file for the API. The file `token.json` must not exist:
```bash
$ freebox-exporter token.json
Could not find the configuration file token.json
Freebox discovery: mDNS
1 Please accept the login on the Freebox Server
...
```You must accept the API on the Freebox device.
Once done, the credentials will be stored in the new file `token.json`
**In case of errors**:
If you get the message `panic: Access is timeout`, you have to be faster to accept the access on the Freebox.
If you get the message `panic: MDNS timeout`, there may be a firewall preventing you to use mDNS. You may try to get the token using HTTP:
```bash
$ freebox-exporter -httpDiscovery token.json
Could not find the configuration file token.json
Freebox discovery: GET http://mafreebox.freebox.fr/api_version
1 Please accept the login on the Freebox Server
...
```### Step 2 run
Once you have generated the token you may run from anywhere.
```bash
$ freebox-exporter token.json
Use configuration file token.json
Listen to :9091
```Then you may test it:
```bash
$ curl 127.0.0.1:9091/metrics
# HELP freebox_connection_bandwith_bps available upload/download bandwidth in bit/s
# TYPE freebox_connection_bandwith_bps gauge
...
```