YAMon - per user & per device usage monitoring

In the spring of 2013, my ISP could not explain how we kept exceeding our monthly usage cap. I did not trust their totals and their reports and the stock graphs & tables on my router did not provide the level of detail I wanted to see - i.e., who used how much data when?

That lead me to develop YAMon - a tool that records and reports on the traffic (downloads and uploads) for all of the devices connecting to your router. The data is aggregated by hour, day and month (within your ISP billing interval) and can be rolled-up into arbitrary groups (e.g., by family member, roommate, device location or function, or by any other logical grouping of devices).

  • Hourly & daily reports allow you to see which devices used how much bandwidth, when? (Did your kids go to school? Did they shut off their devices at bedtime?).
  • The monthly usage report shows who is consuming the most bandwidth on which device and projects your total usage for your ISP billing interval (allowing you to throttle consumption before you get hit with a large overage fee).
  • The devices tab shows all devices that have connected to your network and allows you to organize them into arbitrary logical groups (e.g., by family member or device owner, or by function/location, etc.)
  • The live usage report allows you to see which IP addresses each device is connecting to and includes geo-location lookups (so you can find out why your kid are connecting to a server in Lithunia or elsewhere… no offense intended to anyone from Lithuania)

I just posted v3.3.4 to the YAMon web site - see http://usage-monitoring.com

Let me know if you have any questions or feature requests.



I just installed 3.3.4 over 3.3.2.

After I start, I get the following error on the console:

sh: out of range

Not a big deal since it will go away, but I wonder if it will cause issues.

Thanks again for making this available.

sh: out of range means that there’s an operation on an uninitialized variable… without more info, I can’t tell you which one it is.
On option (if you’re really keen to track down the issue) is to set _log2file=2 and _loglevel=0 in your config.file.
Then run /opt/YAMon3/restart.sh in a PuTTY (or equivalent terminal) window and all logging info will get displayed to the screen…From the logging info, I’ll have a better idea of where in the code the problem occurs.


Unfortunately, the logs were not helpful. What I did end up doing was running:

bash -x startup.sh

which yielded the following:

+ local ipv6_enable=
+ '[' '' -eq 1 ']'
/opt/YAMon3/includes/defaults.sh: line 128: [: : integer expression expected

I found no setting for ipv6 in default_config.file. Then I found:

    if [ "$_has_nvram" -eq 1 ] ; then
            ipv6_enable=$(nvram get ipv6_enable)

So, since I don’t have “nvram” and ipv6_enable is not set, I am guessing I need to explicitly set ipv6_enable somehow. Is that just a matter of setting


in config.file?

Thanks for running with -x…
That message is actually occuring because _has_nvram is undefined and [ “$_has_nvram” -eq 1 ] requires an integer value. If I’d used ‘==’ rather than ‘-eq’ you would not have gotten the message. The better soluion is to initialize that variable.

If you have ipv6 traffic, then edit your config.file and set the value to 1. If you do not have ipv6 traffic, set it to 0.

Is there a uci or other setting in Turris that indicates whether or not ipv6 is enabled?


JFYI. I’m trying YAMon, it’s not really needed in my environment, I just like tools like this :-). Well, the results of the measuring seem to be quite different from what I get from other sources. Here are yesterday results:

YAMon outgoing: 14,1 GB
YAMon measured @ the router: 13,3 GB

My router data from https://project.turris.cz/cs/data/1962/show#/statistics/in-vs-out/2017-10-26/d (official tool): 15,18 GB

I think 2 GB difference is quite a lot. I’m on unlimited plan, but in a limited one 2 gigs difference could be a problem.

agreed! the 2gb difference is unacceptable… but without more info, I can’t begin to explain the discrepancy. YAMon includes extensive logging options (open your config.file and look for _loglevel)

As a general rule (on my router, at least), the YAMon totals are 1-2% lower than what my firmware tallies and 5-6% below what my ISP reports… this has been fairly consistent over the 4+ years that I’ve been running YAMon.


Note that there is typically no clear indication in end customer contracts on what OSI layer the ISP will define its service as well as bandwidth and volumes. This leads to the perverse situation that a customer naively will assume bandwidth/volume as measured with typical speedtests, which often is equivalent with TCP/IPv4/HTTP goodput, while the ISP might actually measure on say ethernet layer (assuming the ISP’s aggregation network runs on ethernet) that will lead to the following bandwidth measurements for the same actual traffic (to make things easier we assume 100 Mbps goodput):

goodput (TCP/IPv4 without TCP options and ignoring the typically miniscule HTTP overhead) as measured by customer:
bandwidth as measured by ISP (assuming accounting of IP packets)
100 * ((1500)/(1500-20-20)) = 102.74 Mbps
bandwidth as measured by ISP (assuming accounting of ethernet)
100 * ((1500+6+6+2+4)/(1500-20-20)) = 103.97 Mbps

So in your case it might well be that your firmware tallies IP-goodput, while the ISP tallies ethernet goodput. I have not looked at what level yamon actually measures…

So, I should set “_has_nvram” to 1? Or I should add “ipv6 = 1” to the config.file somewhere?

I’ve just updated YAMon to version 3.3.5. - see Installing YAMon (3.3.0) on the Omnia (3.7.1) for details.


1 Like