Up/Down statistics in the web interface?

Is there any existing way to show how much data has been uploaded/downloaded each day within the web interface, not some text output in the terminal?

I have searched the web and I got "nlbwmon", but installing it did not change the web interface. It seems that I have to use it in the terminal, but I do not understand how to use it. nlbwmon -c show just returns unrecognised option: c. Having to log into the terminal and executing commands to see the statistics was not what I wanted anyway; I would prefer to view in in the web interface.

You're probably just missing the luci integration, luci-app-nlbwmon.

nlbwmon however doesn't provide daily statistics and just integrates the results monthly, luci-app-vnstat is probably a better solution (downside, it doesn't retain its data over a reboot).

I tried to install it, but there were lots of weird "But that file is already provided by package * luci-base" errors. Searching the web for that, and someone said upgrading "luci-base" fixed it. I upgraded it and then installed "luci-app-vnstat". It seemed to be installed successfully, but when I refreshed the webpage, the page was broken.

Is there a way to fix this?

/usr/lib/lua/luci/template.lua:97: Failed to execute template 'admin_status/index'.
A runtime error occurred: /usr/lib/lua/luci/template.lua:97: Failed to execute template 'header'.
A runtime error occurred: /usr/lib/lua/luci/template.lua:97: Failed to execute template 'themes/bootstrap/header'.
A runtime error occurred: [string "/usr/lib/lua/luci/view/themes/bootstrap/hea..."]:20: attempt to call field 'node_childs' (a nil value)
stack traceback:
	[string "/usr/lib/lua/luci/view/themes/bootstrap/hea..."]:20: in main chunk
stack traceback:
	[C]: in function 'error'
	/usr/lib/lua/luci/template.lua:97: in function 'render'
	/usr/lib/lua/luci/dispatcher.lua:755: in function 'include'
	[string "/usr/lib/lua/luci/view/header.htm"]:3: in main chunk
stack traceback:
	[C]: in function 'error'
	/usr/lib/lua/luci/template.lua:97: in function 'render'
	/usr/lib/lua/luci/dispatcher.lua:755: in function 'include'
	[string "/usr/lib/lua/luci/view/admin_status/index.h..."]:1: in main chunk
stack traceback:
	[C]: in function 'error'
	/usr/lib/lua/luci/template.lua:97: in function </usr/lib/lua/luci/template.lua:85>
	(tail call): ?
	/usr/lib/lua/luci/dispatcher.lua:1020: in function 'dispatch'
	/usr/lib/lua/luci/dispatcher.lua:984: in function 'dispatch'
	/usr/lib/lua/luci/dispatcher.lua:478: in function </usr/lib/lua/luci/dispatcher.lua:477>

I'm personally using nlbwmon (I don't need to break down my data daily, I just want a rough monthly overview), but I do regularly compile current master for my devices. So it should work, but I obviously can't reproduce your setup.

Well, I soft-reset the router, upgraded to 19.07.3, and then installed the package. It did not appear in the web interface first, but when I rebooted the router, it appeared at the bottom of the Status menu.

Vnstat can be configured to save it’s DB to persistent storage if that option is available.

~# cat /etc/vnstat.conf
# vnStat 2.6 config file

# default interface (leave empty for automatic selection)
Interface ""

# location of the database directory
DatabaseDir "/usb/vnstat"

I get Summary, Top, 5 Minute, Daily, Weekly, Monthly, and Yearly data.

If you do it that way, I'd strongly recommend to keep the database directory on a mounted USB stick (or similar). Yes, it does work, but the database is updated continuously --> many, many writes all the time, this can ruin the flash storage prematurely. Doing this on the internal flash could quickly become fatal, USB sticks are a dime a dozen and can easily be replaced when they die.

nlbwmon (rather its OpenWrt specific integration/ procd script) tries to reduce writes, by only updating the on-flash db in regular intervals (e.g. daily), vnstat is a bit more desktop centric and doesn't have that feature (yes, this could be added there as well, but it would need doing).

Absolutely correct. I did show in the .conf snippet that by persistent storage I meant external. (Could have been phrased better). NEVER USE YOUR ROUTER AS A HDD!

Just pointing out to the OP, as you, that vnstat was likely a better solution to their wants and that they ‘could’ achieve it with vnstat if they had an external storage option.

I’ve used vnstat for years on my desktops and write frequency can be mitigated to a certain extent with some careful use of the config options.

And, there is also the possibility of using /var (/tmp) and CRON to lessen write frequency.

As a newbie to this platform, I am not fully there yet, but they are still explorable options for other readers.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.