What's new

[Beta] VNSTAT on Merlin; CLI, UI and email data use monitoring (install script offline for now)

  • 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!

Status
Not open for further replies.
Wanted to give this a try and install. What am I doing wrong?

jadmin@RT-AC86U-07F8:/tmp/home/root# curl --retry 3 "https://raw.githubusercontent.com/MartineauUK/vnstat/main/vnstat-install.sh" -o "/jffs/scripts/vnstat-install.sh" && chmod
755 "/jffs/scripts/vnstat-install.sh" && /jffs/scripts/vnstat-install.sh install
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 14 100 14 0 0 93 0 --:--:-- --:--:-- --:--:-- 105
/jffs/scripts/vnstat-install.sh: line 1: 404:: not found
jadmin@RT-AC86U-07F8:/tmp/home/root#
not there no more. :( Read up a bit https://www.snbforums.com/threads/b...ript-offline-for-now.70091/page-5#post-664211
 
Wanted to give this a try and install. What am I doing wrong?

jadmin@RT-AC86U-07F8:/tmp/home/root# curl --retry 3 "https://raw.githubusercontent.com/MartineauUK/vnstat/main/vnstat-install.sh" -o "/jffs/scripts/vnstat-install.sh" && chmod
755 "/jffs/scripts/vnstat-install.sh" && /jffs/scripts/vnstat-install.sh install
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 14 100 14 0 0 93 0 --:--:-- --:--:-- --:--:-- 105
/jffs/scripts/vnstat-install.sh: line 1: 404:: not found
jadmin@RT-AC86U-07F8:/tmp/home/root#
The install script is offline, I'm sorry to say. I've reached out to @Martineau to discuss.
 
So I installed this by hand, following the instructions (I think) at the github site and I'm getting data, but while the graphs are showing info, I'm not sure it's right... since the graph is showing data that doesn't match the command line output, and I've only been running it for a little over 3 hours:
1613568279105.png

Code:
# vnstat --hours
eth0                                                                     13:18
  ^                                                                    r       
  |                                                                    r       
  |                                                                    r       
  |                                                                    r       
  |                                                                    r       
  |                                                                    r       
  |                                                                    r       
  |                                                                 r  r       
  |                                                                 r  r       
  |                                                              rt rt r  rt   
-+--------------------------------------------------------------------------->
  |  14 15 16 17 18 19 20 21 22 23 00 01 02 03 04 05 06 07 08 09 10 11 12 13   
                                                                              
h  rx (MiB)   tx (MiB)  ][  h  rx (MiB)   tx (MiB)  ][  h  rx (MiB)   tx (MiB)
14        0.0        0.0 ][ 22        0.0        0.0 ][ 06        0.0        0.0
15        0.0        0.0 ][ 23        0.0        0.0 ][ 07        0.0        0.0
16        0.0        0.0 ][ 00        0.0        0.0 ][ 08        0.0        0.0
17        0.0        0.0 ][ 01        0.0        0.0 ][ 09       19.7       19.9
18        0.0        0.0 ][ 02        0.0        0.0 ][ 10      375.9      391.8
19        0.0        0.0 ][ 03        0.0        0.0 ][ 11    1,176.9      401.0
20        0.0        0.0 ][ 04        0.0        0.0 ][ 12    3,025.6      240.4
21        0.0        0.0 ][ 05        0.0        0.0 ][ 13      544.9      444.1

I don't see where the data for hours 7 and 8 could've come from.
 
So I installed this by hand, following the instructions (I think) at the github site and I'm getting data, but while the graphs are showing info, I'm not sure it's right... since the graph is showing data that doesn't match the command line output, and I've only been running it for a little over 3 hours:


I don't see where the data for hours 7 and 8 could've come from.
When vnstats launches initially, it doesn't seem to check the nvram time sync status, and so it may capture the initial few minutes of data under UTC. I've observed this effect most obviously when it's late EST and I reinstalled and it shows me data use for tomorrow (!). It should happen only on the initial collection (I haven't observed it after a reboot).

There is a setting in the vnstat.conf called TimeSyncWait which allows one to specify "how many minutes to wait during daemon startup for system clock to sync time if most recent database update appears to be in the future". But this doesn't apply to the initial boot because there is no data to reference.
 
When vnstats launches initially, it doesn't seem to check the nvram time sync status,
But I think Entware doesn't launch until the time sync takes place--at least when set up under Diversion.
 
and I've only been running it for a little over 3 hours:
Your command line output is from 13:18 which suggests the data set begins at ~10:00. Your image is from 08:13 and shows the 24 hours prior to that point. So I'm guessing the image is showing old data that you collected prior to deleting and recreating the database at ~10:00.
 
Your command line output is from 13:18 which suggests the data set begins at ~10:00. Your image is from 08:13 and shows the 24 hours prior to that point. So I'm guessing the image is showing old data that you collected prior to deleting and recreating the database at ~10:00.
I had not used vnstat prior to today. And the timestamps were probably messed up somewhat due to TZ not being set in my command line nor the startup script for vnstat. I've added the TZ setting now and appear to be getting reasonable data currently. Still don't know where the original "extra" data came from, but it wasn't from running vnstat previously.
 
What's the easiest and cleanest way to remove the script and start over if needed?

For context I have two versions mounted.....Version 0.0.1 (alpha) and another version 0.9.1 (beta). Would like to either remove them both to start over or just remove the outdated alpha. Thanks!

Edit: Fixed, apparently rebooting it fixed the duplicate mounting version issues.
 
Last edited:
What's the easiest and cleanest way to remove the script and start over if needed?

For context I have two versions mounted.....Version 0.0.1 (alpha) and another version 0.9.1 (beta). Would like to either remove them both to start over or just remove the outdated alpha. Thanks!

Edit: Fixed, apparently rebooting it fixed the duplicate mounting version issues.

It's a good question nonetheless. For others desiring to remove, these steps should do it:
  1. Delete the scripts associated with vnstat in the /jffs/scripts and /jffs/add-ons directories.
  2. Remove the cron jobs (cru d job-name) - the job name is either vnstat_daily or vnstat_update
  3. Remove the associated Entware packages (opkg remove package-name)
  4. Reboot
 
I am following this from Day1 and really look into getting this. But, i would like to know if at some point you'll have an integration into AMTM to get it installed/removed/updated?
 
I am following this from Day1 and really look into getting this. But, i would like to know if at some point you'll have an integration into AMTM to get it installed/removed/updated?

Wouldn't that be up to the developer of amtm to decide to include it, not the developer of vnstat?
 
Wouldn't that be up to the developer of amtm to decide to include it, not the developer of vnstat?
Its up to both as @thelonelycoder has a standard that has to be met before he allows any scripts to be incorporated.
 
@dev_null and I had a little chat a while ago :cool:
After which I may have to eat a bit of crow, since my early comments were, um, seemingly premature...

Just need to get the script back (working on that as we speak). Well, teaching myself as we speak.
 
@dev_null Does this work if VLAN tagging? Currently traffic analyzer doesn't work for daily and monthly usage with VLAN tagging. If I disable it and put another modem to connect to ISP first and use Asus as only as AP then traffic analyzer works but I prefer not to do that.
 
Why does CLI show all interfaces and not just the default. nvram get wan0_ifname shows vlan10 but why it shows all interfaces? Also looks like in my case data is going through br0 & eth2?
 

Attachments

  • Capture3.JPG
    Capture3.JPG
    67.6 KB · Views: 93
  • Capture3.JPG
    Capture3.JPG
    68.3 KB · Views: 91
Last edited:
Why does CLI show all interfaces and not just the default. nvram get wan0_ifname shows vlan10 but why it shows all interfaces? Also looks like in my case data is going through br0 & eth2?
Looks like you might have misconfigured the interface in /opt/etc/vnstat.conf
 
I
Looks like you might have misconfigured the interface in /opt/etc/vnstat.conf
I put vlan10 there but if you look at the stats page, vlan10 is not showing much traffic although nvram get wan0_ifname shows vlan10.
 
@dev_null Does this work if VLAN tagging? Currently traffic analyzer doesn't work for daily and monthly usage with VLAN tagging. If I disable it and put another modem to connect to ISP first and use Asus as only as AP then traffic analyzer works but I prefer not to do that.
I don't see a specific flag for VLAN in the vnstat documentation. Not to say it can't but it would seem to need to be associated with an interface. At least that's appears to be how this version of vnstat works.
Why does CLI show all interfaces and not just the default. nvram get wan0_ifname shows vlan10 but why it shows all interfaces? Also looks like in my case data is going through br0 & eth2?
As Jack says, this would seem to be a configuration issue. The conf file should specify the primary iface. Can you describe your setup/connection?
 
Status
Not open for further replies.

Latest threads

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