Wanna see bandwidth broken down by wifi vs wired, per billing cycle

The installation is done like any other package:

opkg update
opkg install luci-app-nlbwmon

(that will install also nlbwmon itself)

Or use LuCI GUI to install it.

But it has a dependency to a kernel module, so if you are running a buildbot snapshot build , you may need to first flash it and then install the package right afertwards. (like all kernel related packages)

1 Like

hnyman,

thank you very much for your reply.

i updated opkg in terminal (refreshedi tried installing luci-app-nlbwmon (through terminal and luci), but it doesn't seem to be available

Unknown package 'luci-app-nlbwmon'.

I'm on LuCI lede-17.01 branch (git-17.152.82987-7f6fc16) / LEDE Reboot 17.01.2 r3435-65eec8bd5f.

I'm a real rookie when it comes to IT stuff. And it looks like getting nlbwmon to work may be harder than just running the opkg commands (or installing via Luci Gui).

Would you kindly tell me whether nlbwmon does what I need it do? (I need something to show my wifi use, and will back up that info so that a powered-off router won't be a loss). I just wanna make sure that all the effort (and for a slow-learning noob like myself, it is a lot of time and effort) will not be in vain. I just wanna make sure nlbwmon meets my needs, and does it better than vnstat.

Yeah, it is not yet available in 17.01, just like I said in my first message:

As far as I understand, the package pretty much answers your needs, as it even enables adjusting the start date of the monitoring period (billing period).

I will enquire from the author if he sees backporting this to 17.01 possible. If that is done, it could be available in 17.01 after a few days.

1 Like

@hnyman,
Thank you so much for your responses to my newbie questions. I really appreciate it a lot. Hopefully, I'll soon see light at the end of the tunnel. :slight_smile:

If I may ask an additional question about nlbwmon: Do you know if it has an easy way to set up automatic backups? I don't want to lose all the precious bandwidth info when there is something like a power outage. Thanks again.

Please look at the screenshots and read the already written messages...

From the screenshots you can see that you can define the directory where the database is stored (e.g. router flash or USB stick, instead of the default RAMdisk ) and the interval how often it is stored there.

2 Likes

Indeed nlbwmon seems like the perfect new solution to all statistic needs, all the existing ones (vnstat, darkstat, etc.) do have a shortcoming one way or another. Very, very nice.

1 Like

The author @jow has now backported it to 17.01 by himself.

Buildbot will build the packages for 17.01 in a few hours.
http://release-builds.lede-project.org/17.01/packages/grid

2 Likes

It seems like it's not of much use now anymore, but for posterity:

You can check if your cronjob exists with crontab -l. I seem to remember that cron needed enabling, but I'm not sure anymore. For good measure, I would do /etc/init.d/cron enable. And whenever a cronjob is started, it will leave a line in the system logfile.

However, if your /etc/vnstat_backup.tar.gz does actually exist, but is a zero-length file, it did fire, and something went wrong in the process. That would need some investigation.

1 Like

@hnyman
Thank you so much for requesting author @jow to backport it. I installed both luci-app-nlbwmon and bwmon through opkg, logged out of Luci and logged back in. I now see a tab called Bandwidth Monitor.

In some earlier replies, @takimata cautioned against too much (too frequent) saving/writing on flash memory, and said a backup script may be around wearing away flash memory. I still don't quite understand all that. (As a tech newbie, I know that the laptop I'm using to type to you on has an SSD and some RAM, and I'm trying to understand how a router is similar or different to a laptop or desktop computer, when it comes to memory.)

Anyway, on http://192.168.1.1/cgi-bin/luci/admin/nlbw/config (looks like https://user-images.githubusercontent.com/2528802/28720681-2d6cb6d6-73ae-11e7-908b-cbe6039ac468.png) , I do see configuration for "Commit Interval". Some preset options are

24 h -- least flash wear at the expense of data loss risk
12 h -- compromise between risk of data loss and flash wear
10 m -- frequent commits at the expense of flash wear
60 s -- commit every minute, useful for non-flash storage

I connected a USB 256MB thumbdrive to the back of the router and mounted it. In the blank that ask for Database Directory , I wrote

/mnt/sda1

Is there a way to verify that everything I've done is correct and complete?

Hi, guys ( @jow @takimata @hnyman and others) ,

Super excited to have luci-app-nlbwmon installed (succesfully, I think!).

In http://192.168.1.1/cgi-bin/luci/admin/nlbw/config#, I see

Should I make any changes in the "Local subnets" section? If so, how do I figure out what to type in there? Thanks for helping a newbie, fellow LEDErs.

Another question.

I have this:

So why is it still empty, like this:

Sat Aug 5 23:07:45 PDT 2017 UPDATE: It now looks like

@takimata

For now, I plan on having nlbwmon and vnstat running concurrently. I think I have finally and successfully set up USB thumbdrive storage.

So what changes should I make to get the vnstat logs saved onto the USB drive? The path is
/mnt/sda1 (or maybe it's /dev/sda1) . And how can I get it to automatically back up every 10 minutes? Thank you so so so much. I think I see the finish line in this long marathon.

I opened up the vnstat.conf we were working on (in sftp://192.168.1.1/etc/vnstat.conf) . I pasted it here: https://gist.github.com/hub2git/34553c65867d3dbde5195fbe998e1798 .

Rows four and five say:

# default interface
Interface "eth0"

Should I leave that as is? Because, as a reminder, I wanna measure my Wifi use (wlan0 and wlan1) .And "eth0" is the entire WAN.

[quote="greenlaser, post:54, topic:4844"]
So what changes should I make to get the vnstat logs saved onto the USB drive? The path is /mnt/sda1 (or maybe it's /dev/sda1) .[/quote]
If you are using my backup script, make the change /etc/init.d/backup_vnstat:

BACKUP_FILE=/dev/sda1/vnstat_backup.tar.gz

Yes, I should have taken that value from the /etc/vnstat.conf "DatabaseDir" value, but my script is still just a stopgap.

Edit your cronjobs with crontab -e and change the line to

*/10 * * * * /etc/init.d/vnstat_backup backup

"*/10" in the minutes column means "every minute value that can be divided by 10", effectively "every 10 minutes". However, keep in mind that USB flash memory wears out just as fast as your router's internal memory. A write every 10 minutes equals ~50000 writes a year, even 10000 may already be too many for a USB stick.

This line is not vitally important. In case you monitor multiple interfaces, it points to which interface you want reports on if you run vnstat from the command line without specifying which interface you want the report on. And if you don't have data on "eth0", you will get an error message, so you might as well change it to one of the interfaces you monitor.

Would you mind sharing your CollectD config? Thanks again.

So for the most part all I've done is enabled specific modules after installing the packages - personally I prefer to allow uci/luci to manage the config files it knows of - so that I don't lose config later because uci didn't understand some stanza in the file.

By default, installing the package collectd-mod-network and configuring that to send to the collectd collector on influxdb will result in statistics for all the modules being sent across there. So just install what you find useful. I use the following:

collectd-mod-cpu
collectd-mod-interface
collectd-mod-load
collectd-mod-memory
collectd-mod-uptime

Apart from enabling all of these (and for mod-interface specifying the wan interface), the only change I made is to add the following for mod-cpu:

<Plugin cpu>
  ValuesPercentage true
</Plugin>

So that it reports in terms of percentage of CPU used, rather than in jiffies - this isn't currently supported by uci/luci

Should I make any changes in the "Local subnets" section? If so, how do I figure out what to type in there? Thanks for helping a newbie, fellow LEDErs

By default it's added all the IP address ranges that are defined in RFC1918 as ones to be used for private networks. It is assuming that most people will be using these internally and NATting at their network edge. You only need to edit this if you are using other ranges within your network (you can probably delete the ones that you aren't using).

Does that apply to NOR Flash memory? (The device I use is vocore2 and my idea was to add a SQL database to log users)

Yes it does, it's generic to flash memory, not specific to a subtype. Ideally you shouldn't be rewriting much at all. Re the SQL idea - can't you just log it to a remote SQL database?