What's new

vnStat [Release] vnStat-on-Merlin - UI, CLI and email - data use and data limit monitoring - R1 and R2

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Are both questions not available?
I have seen this site and I tried a few commands with no success. And I am no programming expert.
If you read the introduction in the first post, you'll see that the primary driver for this app is to track the use of data in relation to data limits put in place by ISPs, thus we are principally interested in the WAN connection. There are other options which you can explore from the CLI. SSH into your router and run vnstat --longhelp. You will see the list of potential CLI options.

Note that changing the configuration from the CLI could adversely effect the setup and data collection of vnStat-on-Merlin, and as I noted above, is not supported, but if you discover something new, feel free to report back.
 
I said “no” to the default eth0, specified vlan1, and it still wrote the .conf for eth0. Edit: after I manually changed .conf file, I got “Error: Interface "vlan1" not found in database.”
Can someone help me set up vnstat to monitor vlan1? Not sure what I’m doing wrong. Thank you!
 
Can someone help me set up vnstat to monitor vlan1? Not sure what I’m doing wrong. Thank you!
I can't reproduce the issue with it not being set correctly on install. Please can you try uninstalling and re-installing, and try using vlan1 again?
 
If you read the introduction in the first post, you'll see that the primary driver for this app is to track the use of data in relation to data limits put in place by ISPs, thus we are principally interested in the WAN connection. There are other options which you can explore from the CLI. SSH into your router and run vnstat --longhelp. You will see the list of potential CLI options.

Note that changing the configuration from the CLI could adversely effect the setup and data collection of vnStat-on-Merlin, and as I noted above, is not supported, but if you discover something new, feel free to report back.

Yes sir seen it. And I know second question was abit on edge. But I do actually have two internet connections. And I do want to see the data of them both. But I will see if I can explore a bit more.
 
I can't reproduce the issue with it not being set correctly on install. Please can you try uninstalling and re-installing, and try using vlan1 again?
Thank you for helping.

I just rebooted, and reinstalled vnstat.

I still have the problem during initial setup, when it detects eth0 as the default, I answer no, and input vlan1, it proceeds to set it up for eth0 anyway.

Then, I use dn-vnstat to edit vnstat.conf, change “eth0” to “vlan1”, and I get this error:
Code:
parse error: Invalid numeric literal at line 1, column 6

After that, if I use option 1 to regenerate stats, I get:
Code:
Error: Interface "vlan1" not found in database.
 
Thank you for helping.

I just rebooted, and reinstalled vnstat.

I still have the problem during initial setup, when it detects eth0 as the default, I answer no, and input vlan1, it proceeds to set it up for eth0 anyway.

Then, I use dn-vnstat to edit vnstat.conf, change “eth0” to “vlan1”, and I get this error:
Code:
parse error: Invalid numeric literal at line 1, column 6

After that, if I use option 1 to regenerate stats, I get:
Code:
Error: Interface "vlan1" not found in database.
there's definitely something wrong with your setup, are you running any other scripts? i get no errors after editing the config via dn-vnstat
 
there's definitely something wrong with your setup, are you running any other scripts? i get no errors after editing the config via dn-vnstat
This is the baffling thing. I’m really not running anything unconventional. Here’s everything I’ve installed:
Code:
amtm 3.2.1 FW             by thelonelycoder
RT-AC1750_B1 (armv7l) FW-386.3 @ 10.48.48.1
    The Asuswrt-Merlin Terminal Menu       

8  open     nsrum                    v30.4.0

vn open     vnStat                    v2.0.3

ep manage   Entware packages

em open     email settings   
dc manage   Disk check script   dcl show log
fd run      Format disk         fdl show log
sw manage   Swap file /mnt/Kingston4GB 2.0G
This is the contents of my /jffs/scripts:
Code:
-rwxrwxrwx    1 admin    root           130 Dec 15 14:13 ddns-start
-rwxrwxrwx    1 admin    root           374 Dec 15 14:13 ddns-start.duckdns
-rwxrwxrwx    1 admin    root           956 Dec 15 14:14 ddns-start.namecheap
-rwxr-xr-x    1 admin    root         75769 Dec 27 22:16 dn-vnstat
-rwxrwxrwx    1 admin    root          1118 Dec 15 14:15 nat-start.vlan
-rwxr-xr-x    1 admin    root         18988 Dec 15 14:46 nsrum
-rwxr-xr-x    1 admin    root           175 Dec 27 22:17 post-mount
-rwxr-xr-x    1 admin    root            57 Dec 15 14:16 pre-mount
-rwxr-xr-x    1 admin    root            68 Dec 27 22:17 service-event
-rwxr-xr-x    1 admin    root            58 Dec 21 09:49 services-stop
There are some older inactive scripts with renamed extensions that shouldn’t get invoked (right? - I don’t see them output anything in syslog): nat-start.vlan and some older ddns-start configurations. The active ddns-start calls inadyn. Everything else was put there by amtm.

Edit: here’s the output in syslog
Code:
Dec 29 15:32:13 vnstat: Starting monitoring for interface vlan1
Dec 29 15:32:13 vnstatd[17196]: Error: pidfile "/opt/var/run/vnstat.pid" lock failed (Invalid argument), exiting.
Dec 29 15:32:13 vnstatd[1595]: SIGTERM received, exiting.
Dec 29 15:32:14 admin: Started vnstatd from .
Dec 29 15:32:14 vnstatd[17225]: vnStat daemon 2.8 started. (pid:17225 uid:0 gid:0)
Dec 29 15:32:14 vnstatd[17225]: Monitoring (1): eth0 (1000 Mbit)
 
Last edited:
End-of-year-housekeeping: v. 2.0.4 (R2) has been published. This update includes some updates to charts, interface id, and uninstall functions.

Happy New Year, and thanks again for using vnStat-on-Merlin!
 
On an AX88U running 386.4 Beta 2
did an uninstall of vnstat then reinstalled (via amtm).

Getting this error:

Sleeping for 60s before generating initial stats

vnstati: error while loading shared libraries: libwebpdecoder.so.4.1.1: cannot open shared object file: No such file or directory
vnstati: error while loading shared libraries: libwebpdecoder.so.4.1.1: cannot open shared object file: No such file or directory
vnstati: error while loading shared libraries: libwebpdecoder.so.4.1.1: cannot open shared object file: No such file or directory
vnstati: error while loading shared libraries: libwebpdecoder.so.4.1.1: cannot open shared object file: No such file or directory
vnstati: error while loading shared libraries: libwebpdecoder.so.4.1.1: cannot open shared object file: No such file or directory
vnstati updating stats for UI

Did a quick opkg check and I don’t see any mention of libwebpdecoder.
Problem with my Entware installation?
 
End-of-year-housekeeping: v. 2.0.4 (R2) has been published. This update includes some updates to charts, interface id, and uninstall functions.

Happy New Year, and thanks again for using vnStat-on-Merlin!
there's definitely something wrong with your setup, are you running any other scripts? i get no errors after editing the config via dn-vnstat

I updated amtm to 3.2.3 and vnstat to 2.0.4.

Going through the initial setup, when I answer 'n' to eth0, I still see it configured as such in vnstat.conf.
Code:
WAN Interface detected as eth0

Is this correct? (y/n)  n

Please enter correct interface:  vlan1

Is this correct? (y/n)  y

/jffs/addons/dn-vnstat.d/vnstat.conf does not exist, downloading now.
Code:
# default interface (leave empty for automatic selection)
Interface "eth0"
But now, when I make the edit to vlan1 in vnstat.conf, I no longer see any error messages!

Whatever housekeeping you made, it's working for vlan1 now, thank you!

One issue solved... still a mystery why eth0 acts differently on my setup. When I get a chance, I'll upgrade Merlin from 386.3_2 to 386.4 and see if that changes anything.
 
Testing my setup again, but now on Merlin 386.4 and measuring eth0 with vnstat 2.0.4.

It started out fairly promising, but over a period of time the rx and tx started to converge. Very bizarre. I’ll keep experimenting but I may have to switch to monitoring vlan1.

1641344028480.png
 
Hi there @dev_null and @Jack Yaz

I love using vnstat and check my internet usage, however I have not been checking it recently due to being away for a while. I now I logged in and I see everything but 'data usage' and 'compare usage' graphs. I'm running version 2.0.4 of the script on RT-AC3200. Is there anything obvious I could do about it?

Regards

Teymur
 
Hi! I hope I am right in this thread. First of all: vnstat is an awesome tool! Just three short questions:
  1. How could I edit the cron time for sending the daily mail and make the change survive updates of vnstat? I'd just need a slightly different time. I wouldn't mind if this leads to vnstat data not exactly covering 24 hours.
  2. Is there a setting that sends a monthly mail? Or does it suffice to just change the daily cron job to monthly?
  3. Turning of the router's hardware accelleration: what effects does this have apart from vnstat?
Thank you very much for your help. :)
 
Hi! I hope I am right in this thread. First of all: vnstat is an awesome tool! Just three short questions:
Thanks for the kind words.
  1. How could I edit the cron time for sending the daily mail and make the change survive updates of vnstat? I'd just need a slightly different time. I wouldn't mind if this leads to vnstat data not exactly covering 24 hours.
You would need to modify the cron job in the jffs scripts within which it is created. You could create a script that would automatically check and overwrite any dn-vnstat entry, but dn-vnstat is pretty stable, so you shouldn't get many dn-vnstat script changes.
  1. Is there a setting that sends a monthly mail? Or does it suffice to just change the daily cron job to monthly?
You would need to create a script, but that's the pretty much the monthly total included in the UI and in the daily summary.
  1. Turning of the router's hardware accelleration: what effects does this have apart from vnstat?
This has been asked several times. HA has a variable impact on data usage counts: anything that modifies how data transitions the IP stack can lead to inaccurate counts. In my limited testing with HA enabled, my totals seem reasonably accurate, but I only use 10-20 gig/day.
Thank you very much for your help. :)
 
Thank you. Done. :) It works. And I left HA on, too ... hoping it doesn't affect measurements considerably. I have a lot less traffic.
 
Incorrect upload stats. Today I uploaded some files to cloud storage.. Total file size of multiple files was around 12-13 GB but vnstat shows I uploaded 53 GB which is impossible. My upload speeds is not fast enough for me to upload that much data is such short time.
1645239144557.png

1645239223782.png
 
Last edited:
Incorrect upload stats. Today I uploaded some files to cloud storage.. Total file size of multiple files was around 12-13 GB but vnstat shows I uploaded 53 GB which is impossible. My upload speeds is not fast enough for me to upload that much data is such short time.
View attachment 39628
HW acceleration enabled? If so, anything that modifies the IP stack can lead to variable accounting. If HW not enabled, advise on setup, connection speeds and topology, please.
 

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top