Skip to content

OpenWRT monitoring

Prometheus metrics

Install:

apk update
apk list|grep promet
apk install \
  prometheus-node-exporter-lua-openwrt \
  prometheus-node-exporter-lua-wifi

These packages provide extra metrics, although those are not really intresting (-nat_traffic monitors traffic to all different IP addresses i.e.):

apk install \
  prometheus-node-exporter-lua-netstat \
  prometheus-node-exporter-lua-nat_traffic

Fix duplicate TYPE definitions which break the upload of metrics to the pushgateway until the pull request arrives in the prometheus-node-exporter-lua package:

cp /usr/lib/lua/prometheus-collectors/netclass.lua /usr/lib/lua/prometheus-collectors/netclass.lua.bak
wget \
  -O /usr/lib/lua/prometheus-collectors/netclass.lua \
  https://raw.githubusercontent.com/openwrt/packages/master/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/netclass.lua

Bind prometheus-node-exporter-lua to lan interface (the tailscale0 interface is not supported though):

sed -i 's/loopback/lan/' /etc/config/prometheus-node-exporter-lua
service prometheus-node-exporter-lua restart

Query metrics:

curl 192.168.8.1:9100/metrics

Grafana dashboard

Traffic monitoring

nlbwmon

  • nlbmon
  • Simple conntrack/netlink based traffic accounting

Usage:

nlbw -c show

nlbw -c show -g mac,fam -o conn

Other standalone tools

Actively maintained tools which allow historical view, which can get installed as apk:

  • vnstat
  • darkstat
    • Openwrt wiki page
    • Shows hosts

      Darkstat shows the traffic in real time the traffic for different hosts within your network, but it does not show the traffic profile of the various host over time.

Luci integrated:

Unmaintained tools:

Unknown, no source found: