OpenWRT monitoring
Prometheus metrics
- OpenWrt and prometheus-node-exporter
- Monitor OpenWrt nodes with Prometheus
- Install sizes:
- prometheus-node-exporter-lua: 4Kb (116 Kb incl. dependencies)
- All other
prometheus-node-exporter-lua-*
packages: 24Kb - Alltogether: 140Kb
Install:
opkg list|grep promet
opkg install \
prometheus-node-exporter-lua \
prometheus-node-exporter-lua-openwrt \
prometheus-node-exporter-lua-wifi \
prometheus-node-exporter-lua-wifi_stations
These packages provide extra metrics, although those
are not really intresting (-nat_traffic
monitors traffic to all different
IP addresses i.e.):
opkg 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:
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 opkg:
- vnstat
- Openwrt wiki: vnStat
- Only overall traffic monitoring, no details about hosts/protocols
- 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:
- luci-app-statistics
Based on
collectd
? - luci-app-vnstat
Unmaintained tools:
- bmon (last commit 2020-02)
- bwmon (last commit 2012)
- bandwithd (last commit 2017) Also: can't monitor ipv6
- wrtmwmon last commit 2020-05
- collectd last release 2020
- YaMon-v4 last commit 2020-06
- iptraf-ng last commit 2020-12
- cshark last commit 2020-07
Unknown, no source found:
- netifyd: DPI server