Prometheus exporter for MeshCore repeaters, read over the mesh: a companion (USB, BLE, or a companion identity in openHop over TCP) logs in to each repeater, asks for status and telemetry with direct packets and serves battery, temperature/humidity, noise floor, RSSI/SNR, packet counters, airtime and uptime on :9200/metrics. - meshcore_exporter.py: command line, MC_* environment or a TOML file with a password per repeater; --check reads every repeater once and exits; interval 1 h (min 15 min); a failed repeater is retried once after 3 min; contacts fetched once per round. - dashboards/: the Grafana dashboard, generated from generate.py (datasource, job and the rate window are variables; TX drawn above zero, RX below). - stack/: Docker Compose with Prometheus and Grafana provisioned, for a USB companion, or on the host network for openHop on the same machine. - systemd/: running without Docker. - README.md (Czech) and AGENTS.md for setting it up with an AI agent. - CI: lint and tests, gitleaks; PR check builds the image; single-platform images per architecture behind a Trivy gate (latest-<arch>, and X.Y.Z-<arch> with a release on tag vX.Y.Z); dependencies by Renovate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
59 lines
2.3 KiB
YAML
59 lines
2.3 KiB
YAML
# Exporter + Prometheus + Grafana with the dashboard ready.
|
|
#
|
|
# cp .env.example .env # fill in: port of the radio, repeater, password
|
|
# docker compose up -d
|
|
# open http://localhost:3000 (admin / GRAFANA_PASSWORD from .env)
|
|
#
|
|
# Already have Prometheus and Grafana? You do not need this file: run only the
|
|
# exporter (README, section "Jen exportér").
|
|
|
|
services:
|
|
exporter:
|
|
image: git.rfa.cz/tth-pub/meshcore-exporter:${MC_VERSION:-latest}-${MC_ARCH:-amd64}
|
|
# build: .. # or build it from this checkout instead
|
|
restart: unless-stopped
|
|
env_file: .env
|
|
# USB companion: MC_SERIAL_HOST in .env is mapped here. Without one
|
|
# (openHop companion over TCP) /dev/null stands in and nothing uses it.
|
|
# openHop on this machine: docker-compose.host.yml (see .env.example).
|
|
devices:
|
|
- "${MC_SERIAL_HOST:-/dev/null}:/dev/meshcore"
|
|
# The serial port's group on the host (`stat -c %g /dev/ttyACM0`):
|
|
# dialout = 20 on Debian/Ubuntu/Raspberry Pi OS, uucp = 986 on Arch.
|
|
group_add:
|
|
- "${MC_SERIAL_GID:-20}"
|
|
# Per-repeater passwords: put them in repeaters.toml (see
|
|
# repeaters.example.toml), set MC_CONFIG=/config/repeaters.toml in .env
|
|
# and uncomment the volume:
|
|
volumes: []
|
|
# - ./repeaters.toml:/config/repeaters.toml:ro
|
|
|
|
prometheus:
|
|
image: prom/prometheus:v3.15.1@sha256:fa3302279710be2f21a8301ec17a8b4f2301fd829bd113839b3b6b02b6f191a2
|
|
restart: unless-stopped
|
|
command:
|
|
- --config.file=/etc/prometheus/prometheus.yml
|
|
- --storage.tsdb.path=/prometheus
|
|
- --storage.tsdb.retention.time=${PROMETHEUS_RETENTION:-400d}
|
|
volumes:
|
|
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
|
- prometheus:/prometheus
|
|
|
|
grafana:
|
|
image: grafana/grafana:13.3.0@sha256:488984b716c0862639f91a698adbe2862677a5a07bad42da5f03f3030883b205
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${GRAFANA_PORT:-3000}:3000"
|
|
environment:
|
|
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_PASSWORD:?set GRAFANA_PASSWORD in .env}
|
|
GF_ANALYTICS_REPORTING_ENABLED: "false"
|
|
GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH: /var/lib/grafana/dashboards/meshcore-repeater.json
|
|
volumes:
|
|
- ./grafana/provisioning:/etc/grafana/provisioning:ro
|
|
- ../dashboards:/var/lib/grafana/dashboards:ro
|
|
- grafana:/var/lib/grafana
|
|
|
|
volumes:
|
|
prometheus:
|
|
grafana:
|