Raspberry Pi Networking Monitoring HomeLab

Raspberry Pi as a Network Monitor

February 1, 2026 · 10 min read

Setting up a Raspberry Pi 4 with Pi-hole, Grafana, and Prometheus to block ads, monitor DNS queries, and visualise network traffic in real time.

[READ ON EXTERNAL SITE ↗]

A Raspberry Pi 4 (4 GB) costs $55. For that price you get a always-on Linux box that can block ads network-wide, collect metrics from every device on your network, and serve a Grafana dashboard — all simultaneously.

What we are building

  1. Pi-hole — DNS-level ad and tracker blocker for the entire network
  2. Prometheus — time-series metrics collector
  3. Grafana — dashboard to visualise everything
  4. pihole-exporter — bridge between Pi-hole stats and Prometheus

Install Pi-hole

curl -sSL https://install.pi-hole.net | bash

Set a static IP on the Pi first. Then point your router’s DHCP to hand out the Pi’s IP as the DNS server for all clients.

# /etc/dhcpcd.conf
interface eth0
static ip_address=10.0.20.10/24
static routers=10.0.20.1
static domain_name_servers=127.0.0.1

Install Prometheus

sudo apt install prometheus

Default config scrapes itself every 15s. We will add pihole-exporter as a target.

Install pihole-exporter

wget https://github.com/eko/pihole-exporter/releases/latest/download/pihole_exporter-linux-arm
chmod +x pihole_exporter-linux-arm
./pihole_exporter-linux-arm -pihole_hostname 127.0.0.1

Add to Prometheus scrape config:

scrape_configs:
  - job_name: pihole
    static_configs:
      - targets: ['localhost:9617']

Install Grafana

sudo apt install grafana
sudo systemctl enable --now grafana-server

Import dashboard ID 10176 (Pi-hole Exporter) from grafana.com — it gives you blocked queries %, top blocked domains, query rate, and client breakdown out of the box.

Metrics worth watching

Performance on Pi 4

After 30 days of continuous operation: CPU never exceeded 12%, RAM usage settled at ~380 MB. The SD card is the bottleneck — use a good A2-rated card or boot from USB SSD.

[← BACK TO BLOG]