Hi all,
I'd like to share a project I've been running on my own routers for a while: cgmon, a monitor for the internet uplink, devices, switch ports and traffic on OpenWrt / ImmortalWrt. It is GPL-3.0, and I'm the author.
The design idea: cgmon is a conductor, not a router. No packet ever passes through it — the kernel forwards everything as usual. cgmon watches through the kernel (conntrack and nftables counters over netlink, AF_PACKET copies of SYN/RST and DNS answers, sysfs/ethtool for ports) and, only when you enable it, loads its own rules: separate nftables tables next to fw4 (fw4 rules are never edited, the firewall is never reloaded), ip rule/routing tables, a tc queue. If cgmon stops or crashes, the router keeps working with the last rules.
What it does:
- WAN state from TCP probes over IPv4 and IPv6, with a plain-language incident journal (e.g. "IPv4 failing while IPv6 works — provider-side CGNAT issue")
- down detector: which sites stop answering your clients while the internet is fine, and a TCP-traceroute "culprit search" that names the peering point all bad paths share
- ports and cables: link drops, CRC errors, downshifts — also per port of swconfig switches
- per-device traffic with a chart whose history is kept on the router
- gateway failover and per-network gateway maps (works with the stock busybox
ip) - optional SQM (cake/HTB), an upload shaper, a DNS guard for one-protocol failures
- a hub that collects state from several routers and alerts in Telegram (encrypted reports)
It is a single static binary with the web page embedded: ~1 MB UPX-packed (lite/nano builds) or 2–3 MB plain, 3–5 MB RAM. It runs on a TL-WR1043ND as well as on x86. Builds for x86_64, i686, aarch64, armv7, armv5te, mips and mipsel, plus .apk (25.x) and .ipk (24.10 and older) packages that check the CPU before installing. Out of the box it only observes — nothing is blocked, shaped or sent anywhere until you turn it on.
Honest limitations: journal messages and the CLI are still in Russian (the web UI is in English); the packages are not signed (apk add --allow-untrusted); conntrack-heavy features cost some CPU on very weak routers.
Code, screenshots and releases: https://github.com/real4root/cgmon
I'd be glad to hear feedback, especially from people on hardware I haven't tested (ramips mt7621, ipq40xx, mvebu).