Linux bridge (br0) traffic in the KDE Plasma 6 network monitor

A small ksystemstats plugin that exposes Linux bridge interfaces as system monitor sensors, so the stock Network Speed widget can graph host-only br0 traffic on a fixed scale.

Repository Source

If you landed here from a search engine, this is probably what you are seeing:

Cause

ksystemstats 6 deliberately skips non-hardware devices. Both of its network backends — the NetworkManager one and the rtnetlink one — drop interfaces of type bridge. The traffic counters are there in /sys/class/net/br0/statistics/; nothing reads them.

The 14 Mbit/s problem is separate. Plasma's unit dropdown does not offer Kbps/Mbps/Gbps for a bps sensor, so the range must be typed in bits per second, and the range spin box stores value × 100 in a 32-bit integer. Anything above about 21.47 million overflows: 100,000,000 becomes 14,100,654.08.

Fix

The plugin finds every interface with a /sys/class/net/<iface>/bridge directory and publishes it under its own bridge/ container, so it never collides with the stock network/ sensors:

SensorUnit
bridge/<iface>/download, uploadB/s
bridge/<iface>/downloadBits, uploadBitsbps
bridge/<iface>/downloadKbps, uploadKbpsKbps
bridge/<iface>/downloadMbps, uploadMbpsMbps
bridge/<iface>/downloadGbps, uploadGbpsGbps
bridge/<iface>/totalDownload, totalUploadB

The Kbps/Mbps/Gbps variants exist for the overflow above: with a sensor already in Mbps, a 0–100 Mbit/s range is typed as 0 and 100.

Bridges are rescanned every 10 seconds. On every other tick the plugin does one pread() per counter on files it keeps open, reads nothing while no client is subscribed, and updates only the sensors a client is watching.

Build and install

Dependencies on Ubuntu/Debian: cmake g++ qt6-base-dev libksysguard-dev libkf6coreaddons-dev libsensors-dev.

git clone https://github.com/zirize/ksystemstats-bridge.git
cd ksystemstats-bridge
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$HOME/.local"
cmake --build build -j"$(nproc)"
cmake --install build

The plugin lands in ~/.local/lib/qt6/plugins/ksystemstats/, which the daemon does not search by default. A systemd drop-in for its user service adds the path:

mkdir -p ~/.config/systemd/user/plasma-ksystemstats.service.d
cp systemd/plasma-ksystemstats.service.d/bridge-plugin.conf \
   ~/.config/systemd/user/plasma-ksystemstats.service.d/
systemctl --user daemon-reload
systemctl --user restart plasma-ksystemstats.service

Widget setup: fixed 0–100 Mbit/s

  1. Add the stock Network Speed widget to a panel and open its settings.
  2. Sensors Details: remove the network/* sensors, add Bridge → br0 → Download Rate in Mbps (bridge/br0/downloadMbps), and uploadMbps if you want it.
  3. Appearance: line or bar chart; hide title, grid lines and legend for a compact graph.
  4. Line Chart Details: turn off the automatic range, set minimum 0 and maximum 100.

Verify

kstatsviewer --list | grep '^bridge/'
kstatsviewer --remain bridge/br0/downloadMbps

The first command lists the sensors for every bridge; the second streams the live rate. Compare it with a download of known speed, or with rx_bytes read twice a second apart.

Tested on Ubuntu 26.04.1 LTS, KDE Plasma 6.6.7, ksystemstats 6.6.7, with the user-local install above. A system-wide install into the distribution's Qt plugin directory should not need the drop-in, but has not been tried.

License: GPL-2.0-or-later. Full README, source and the design note on the per-tick path are in the repository.