Skip to content
Contents
GuidesOpenWrt

How to turn OpenWrt nlbwmon daily records into weekly, monthly and annual totals

A week that spans two months needs records for those seven days. Monthly totals cannot tell you how much traffic fell on either side of that boundary.

A week that spans two months needs records for those seven days. Monthly totals cannot tell you how much traffic fell on either side of that boundary.

Check dates and retention

Over SSH, check the router clock, settings and saved start dates. In LuCI choose by date rather than list position.

date
uci show nlbwmon
nlbw -c list

A database_interval of 1 starts each month on the first. The example 2026-12-01/1 starts daily periods on that date. No history is reconstructed. With database_generations set to ten, export regularly to cover a month.

Switch only if you need daily records

Export old periods, stop the service cleanly and back up its configuration and database on your computer. Check the instance, adjust the section and date below, and keep persistent copies if database_directory is temporary.

uci set 'nlbwmon.@nlbwmon[0].database_interval=2026-12-01/1' &&
uci commit nlbwmon &&
/etc/init.d/nlbwmon restart
OpenWrt 25.12.6 · nlbwmon · database_interval = 2026-12-01/1
OpenWrt 25.12.6 · nlbwmon · database_interval = 2026-12-01/1

In an isolated OpenWrt 25.12.6 VM the list was initially empty. Generate traffic on a tracked device, wait for refresh and check current records. After a save, list dates again and substitute the actual start below. The first day may be partial.

nlbw -c show
nlbw -c list
nlbw -t 2026-12-04 -c csv

Count each period once

Keep one final snapshot per date and scope. Group rx_bytes and tx_bytes by start date and device. With seven daily subtotals in columns B and C, this example gives combined GiB. Exclude grand totals.

=(B2+B3+B4+B5+B6+B7+B8+C2+C3+C4+C5+C6+C7+C8)/1073741824
OpenWrt 25.12.6 · nlbwmon · CSV · database_interval = 1
OpenWrt 25.12.6 · nlbwmon · CSV · database_interval = 1

Use seven consecutive days, all days of the calendar month or twelve complete calendar months. Flag missing days and timestamp partial totals. The serial log shows daily data and an empty monthly record after reverting. Export each series separately. To roll back, restore matching settings and backup, restart and verify history and new traffic. The lab checked switching and reading only.

How to export OpenWrt nlbwmon records by period as CSV and JSON

Explore hardware

Comments