#!/usr/bin/env bash # # Homelab monitoring, Part 7: An ISP report card with outages, ping and speed tests # https://www.zadran.net/guides/homelab-monitoring-7-isp-report-card # Generated from the guide, last updated 2026-10-13. # # NO WARRANTY. This script is provided as is. You are responsible for # understanding what it does before running it, and for the consequences. # Take a backup first. See https://www.zadran.net/disclaimer # # Destructive steps are left commented out on purpose -- uncomment them # only once you have understood what they do. # # Where the guide writes a file with <<'EOF' and your values are in it, # this script uses < blackbox/blackbox.yml <<'EOF' modules: icmp: prober: icmp timeout: 5s icmp: preferred_ip_protocol: ip4 ip_protocol_fallback: false EOF curl -fsSL -o speedtest/Dockerfile https://www.zadran.net/downloads/grafana/speedtest/Dockerfile curl -fsSL -o speedtest/speedtest_exporter.py https://www.zadran.net/downloads/grafana/speedtest/speedtest_exporter.py ls -l blackbox speedtest cd /opt/monitoring mkdir -p backup cp compose.override.yaml backup/compose.override.yaml.$(date +%Y%m%d-%H%M%S) 2>/dev/null [ -f compose.override.yaml ] || echo "services:" > compose.override.yaml cat >> compose.override.yaml <> $P <&1 | tail -2 D=${CONTRACT_DOWN} curl -fsSL https://www.zadran.net/downloads/grafana/alerting/isp.yaml | sed -e "s/777 Mbit/$D Mbit/g; s/388\.5\]/$((D/2))]/g" > /opt/monitoring/grafana/provisioning/alerting/isp.yaml grep -n 'Mbit\|params: \[' /opt/monitoring/grafana/provisioning/alerting/isp.yaml cd /opt/monitoring && docker compose restart grafana