tchapacan / livebox-exporter-rs

A livebox exporter built in rust for prometheus
MIT License
16 stars 0 forks source link
grafana livebox monitoring network-monitoring open-telemetry prometheus prometheus-exporter rust

livebox-exporter-rs

version license github ci workflow ossf scorecard

A basic livebox exporter written in rust 🦀. Start monitoring your livebox router's using Prometheus / Grafana 💪.

Features

grafana dashboard

Metrics

Metric Name Description Type
livebox_infos_status Livebox general status gauge
livebox_infos_uptime Livebox uptime gauge
livebox_infos_reboot Livebox count of reboots gauge
livebox_wan_status Livebox wan status gauge
livebox_link_status Livebox link status gauge
livebox_interface_bytes_rx Livebox interface bytes received gauge
livebox_interface_bytes_tx Livebox interface bytes transmitted gauge
livebox_device_status Livebox connected devices status gauge

Usage

Docker

  1. Pull latest docker image: to your local machine.

    docker pull tchapacan/livebox-exporter-rs:latest
  2. Run the Exporter: run the docker images, using the options.

    docker run -d --name livebox-exporter-rs -h livebox-exporter-rs -p <exporter_port>:<exporter_port> tchapacan/livebox-exporter-rs:latest --password <livebox_password> --port <exporter_port>
  3. Access Metrics: Once the exporter is running, access the exposed metrics at:

    http://localhost:<exporter_port>/metrics

Sources

  1. Clone the Repository: to your local machine.

    git clone https://github.com/tchapacan/livebox-exporter-rs.git
  2. Build the Project: go to the project directory and build the project.

    cd livebox-exporter-rs
    cargo build --release
    cd target/release/
  3. Run the Exporter: run the binary, using the options.

    ./livebox-exporter-rs -P <livebox_password> -p <exporter_port>
  4. Access Metrics: Once the exporter is running, access the exposed metrics at:

    http://localhost:<exporter_port>/metrics

Options

Supported command-line options (hope -P vs -p not to confusing):

Option Description Default Value
-P, --password Livebox password (required) None
-p, --port Exporter port 9100
-l, --listen
Listen address 0.0.0.0
-G, --gateway
Livebox gateway ip address 192.168.1.1
-v, --verbose Enable verbose logging (repeat for increased verbosity) Off
-h, --help Display help message N/A
Usage: livebox-exporter-rs [OPTIONS] --password <password>

Options:
  -p, --port <port>          exporter port [default: 9100]
  -l, --listen <address>     listen address [default: 0.0.0.0]
  -v, --verbose...           verbose logging
  -P, --password <password>  Livebox password [required]
  -G, --gateway <gateway>    Livebox gateway ip address [default: 192.168.1.1]
  -h, --help                 Print help
  -V, --version              Print version

Details

overview schema

Example (docker-compose)

Grafana/prometheus/livebox-exporter-rs

example
├── .env
├── docker-compose.yaml
├── grafana
│   ├── HomeLan.json
│   └── datasource.yml
└── prometheus
    └── prometheus.yml

Requirements

Environment Variables

cd example && cp .env.example .env

Update env..

Update your LIVEBOX_PASSWORD env secrets variable and source it

source .env

Docker Compose

Accessing Grafana

Import dashboard template

Metrics might take few mins to come up (connected devices graph is 1h delayed in grafana due to default configuration)

Contributing

Contributions are really welcome! If you encounter any issues, have suggestions, or would like to add/fix features, please do:

For more details here are the contribution guidelines

Security

If you discover any security-related issues, please follow the responsible disclosure process and report a security issues here. Thank you!

Alternatives

Legal

Livebox is a trademark owned by France Telecom and Orange, and is their property. This tool only uses the name as it is the router this exporter is about. No intellectual property infrigement intended. This work has been done for educational purpose as a personal monitoring side project and shared to the community. If there's any issue with the use of this name here, please don't hesitate to contact me.