$ webtoolist --read
Home Network Monitor
hard · 4-6 hours
Watch your home network's health with Prometheus metrics, Grafana dashboards, and alerting — all in Docker on one box.
monitoringprometheusgrafanadockernetworkingself-hosting Safety notes:
- Never expose Prometheus or Grafana directly to the internet; keep them behind a VPN or reverse proxy with authentication.
- Alerting rules that page you at 3 a.m. for non-issues burn you out — start with silent dashboards, add alerts only for things that need action.
Parts
- Always-on Linux machine or Raspberry Pi 4+ (4 GB RAM recommended)
- Optional: USB Z-Wave/Zigbee stick if you later extend into smart-home monitoring
Tools
- Docker and Docker Compose installed on the host
- SSH access to the host
- Web browser for the Grafana dashboard
Prometheus + Grafana is the industry-standard monitoring stack, and it shrinks down to a home network without drama. You get historical graphs of every interface, disk, and container, plus up/down checks for the devices that matter — and a beautiful wall-clock dashboard to justify the effort.
Steps
- Plan the layout. Three containers:
prometheus(collects and stores metrics),node-exporter(exposes host metrics),grafana(dashboards). If you want router/switch data, your gear must support SNMP — check its admin UI before proceeding. - Scaffold the stack. Create a directory with this
docker-compose.yml:services: prometheus: image: prom/prometheus volumes: ["./prometheus.yml:/etc/prometheus/prometheus.yml"] ports: ["9090:9090"] node-exporter: image: prom/node-exporter pid: host volumes: ["/:/host:ro,rslave"] command: ["--path.rootfs=/host"] grafana: image: grafana/grafana ports: ["3000:3000"] volumes: ["grafana_data:/var/lib/grafana"] volumes: grafana_data: - Configure scraping. Create
prometheus.yml:
Replace the blackbox targets with your router, NAS, and a public DNS endpoint.scrape_configs: - job_name: node static_configs: - targets: ["node-exporter:9100"] - job_name: blackbox metrics_path: /probe params: module: [icmp] static_configs: - targets: ["192.168.1.1", "192.168.1.20", "1.1.1.1"] - Add up/down probes. Add a
blackbox-exporterservice (imageprom/blackbox-exporter) to compose. It pings your targets so Prometheus can graph reachability — this is what tells you “the internet is down” versus “the server is down.” - Bring it up and verify.
docker compose up -d, then checkhttp://<host>:9090/targets— all jobs should report UP. Fix firewall rules if anything is down before continuing. - Build the dashboard. Log into Grafana (default
admin/admin— change it), add Prometheus athttp://prometheus:9090as a data source, then import community dashboards by ID: 1860 (Node Exporter Full) is the standard host overview. Add panels for your blackbox probes:up{job="blackbox"}. - Make it useful over time. Grafana’s real value appears after a week of history. You’ll see the disk filling, the memory leak, the 2 a.m. DHCP storm. Set Grafana’s retention (Prometheus config
--storage.tsdb.retention.time=90d) accordingly. - Restrict access. Bind the ports to localhost (
127.0.0.1:9090:9090) and reach the stack through a VPN (WireGuard) or an authenticated reverse proxy. Dashboards expose your network’s topology; they are not for the LAN party guest.
Troubleshooting
- Targets show DOWN in Prometheus → 90% of the time it’s the firewall on the target, not Prometheus. Test with
pingandcurl <target>:9100/metricsfrom inside the Prometheus container. up{job="blackbox"}always 0 → ICMP probes needNET_RAWcapability; addcap_add: [NET_RAW]to the blackbox service, or switch the probe module tohttp_2xxfor URL checks instead.- Grafana can’t reach Prometheus → inside a compose network, containers talk by service name, not
localhost. Usehttp://prometheus:9090. - Dashboards empty after import → dashboards hard-code a metric prefix that may differ (
node_memory_MemAvailable_bytesvs older names). Check the Prometheus query browser for the actual metric names and adjust. - Prometheus uses all the disk → cardinality explosion, usually from too many targets or misconfigured exporters. Set
--storage.tsdb.retention.size=2GBand audit high-label metrics. - Clock drift on the Pi makes graphs jagged → enable NTP (
timedatectl set-ntp true); Prometheus and exporters must agree on time.