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

It is recommended to build the image locally to ensure that it is compatible with you platform.

docker build -t rpi5_wanBot_exporter -t registry.gitlab.com/niklasme/wanbot:latest.

To bring up the container without mounted volumes for reading fan speed ant temperature sensors.

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. If the container fail to start, ensure that it is compatible with your platform; i.e. amd64 aarch64 etc.

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/:/sensors/hwmon: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.3.tar.gz (436.6 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.3-py3-none-any.whl (438.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rpi5_wanbot_exporter-0.3.tar.gz
  • Upload date:
  • Size: 436.6 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.3.tar.gz
Algorithm Hash digest
SHA256 5e605b64e72f8774147634005ab2f9d96246496ecc8aef7b148a241eadbb5427
MD5 b50a910ae0c50254cf80a1d1f96d8224
BLAKE2b-256 5bd0e6b8b69c11860c905db0ab5b4edd305be454baee9fc71fb2dc3d2906921d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rpi5_wanbot_exporter-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9cd7cb04045f416626582cd8b120d6a3cf27ba8646b15c0ce9be62ebb137cf83
MD5 091e8cb8304c9717d1f8a37cf3ec4953
BLAKE2b-256 7cc945341b235a2816e45bc3eb46a39c812ce46180216a5fe6f43621128011c0

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