Skip to main content

Application to check WAN connection and export metrics to Prometheus

Project description

Raspberry Pi 5 Wan Bot Exporter

Raspberry Pi Prometheus exporter. Works in Docker or as a standalone script to export data to Prometheus. It uses python's internal webserver. Supports Raspberry Pi 5 and Raspbian-based images. Currently exports:

  • Ping to requested sites
  • Upload, Download and latency to Bredbandskollen

Requirements

  • Python 3.x
  • (optional) Docker

Usage

Docker

docker build -t rpi5_wanBot_exporter .
docker run -d -p 8878:8878 --name rpi5_wanBot_exporter rpi5_wanBot_exporter

Docker compose

You can also use Docker compose to simplify the process by placing the following content in the docker-compose.yaml file and also add the required links to the files containing the fan speed and cpu temperature.

services:
  rpi5_wanBfot_exporter:
    image: registry.gitlab.com/niklasme/wanbot:latest
    container_name: rpi5_wanBot_exporter
    ports:
     - 8878:8878
    volumes:
      - /sys/devices/platform/cooling_fan/hwmon/hwmon2/fan1_input:/sensors/fan:ro
      - /sys/class/thermal/thermal_zone0/temp:/sensors/temp:ro

Bring up the container after building it with docker compose up. The additional -d is to run in detached mode as a service.

docker build -t rpi5_wanBot_exporter .
docker compose up -d

Standalone

  • clone this repository or download the script to your Raspberry Pi 5
  • run the exporter python3 rpi5_wanBot_exporter.py --webserver --port 8878

Integration with Prometheus:

To integrate with Prometheus, add the following job to your Prometheus configuration file (prometheus.yml):

scrape_configs:
  - job_name: 'rpi5_wanBot_exporter'
    static_configs:
      - targets: ['<Raspberry_Pi_IP>:8878']

License

This script is provided under the MIT License. See the LICENSE file for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rpi5_wanbot_exporter-0.2.tar.gz (436.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rpi5_wanbot_exporter-0.2-py3-none-any.whl (437.7 kB view details)

Uploaded Python 3

File details

Details for the file rpi5_wanbot_exporter-0.2.tar.gz.

File metadata

  • Download URL: rpi5_wanbot_exporter-0.2.tar.gz
  • Upload date:
  • Size: 436.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for rpi5_wanbot_exporter-0.2.tar.gz
Algorithm Hash digest
SHA256 b29cbfb6f4ce3c99efe75199a976d7e84e48af4ee59f051f9c70442f15f02eba
MD5 3e3099e25b6301513c2f8d91d5d823d1
BLAKE2b-256 0193912ec571dc62f924405ee1c850742ba449e60e96c6817f123f802678057c

See more details on using hashes here.

File details

Details for the file rpi5_wanbot_exporter-0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for rpi5_wanbot_exporter-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2e329c13ae77312ddf758a810fd339e378f2ff86898cf80fd7e0e6595d1f76c9
MD5 6412b34fd86a5668c4b08cc86f23f969
BLAKE2b-256 05a710aa4e5366fd37c3cebd4a3ad9c598b879ed7c508e8d8cc06005acbcd7ac

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page