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.

rpi5_wanBot_exporter:
  image: rpi5_wanBot_exporter
  container_name: rpi5_wanBot_exporter
  restart: unless-stopped
  ports:
   - 8878:8878
  volume:
    - /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.1.tar.gz (436.2 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.1-py3-none-any.whl (437.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rpi5_wanbot_exporter-0.1.tar.gz
  • Upload date:
  • Size: 436.2 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.1.tar.gz
Algorithm Hash digest
SHA256 69152df3920aa97ade00aea677675a6ace73607bdec93915cb4267051eb999ce
MD5 7a1e5a6e64cb400a819ea9b574cdc1b0
BLAKE2b-256 a9d1fe028762cd4ee0d0b6b8fa76621609a6c9816b9770c69341168b0ec98c6d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rpi5_wanbot_exporter-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ab6c60cbb6389cf580b3edd974df479aa1cc5826358bd383d75f63a9ecf5abea
MD5 a4ed3d2b8e9bdf0ca7e886079872dc8f
BLAKE2b-256 dd2eec983c3ce100221185e773f85164800da7fc313eb9fa471f73ae5a742541

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