dd-wrt - Bandwidth Usage Monitor

Post new topic   This topic is locked: you cannot edit posts or make replies.    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page Previous  1, 2, 3 ... , 40, 41, 42  Next
Author Message
al_c
DD-WRT Guru


Joined: 13 Apr 2013
Posts: 2134
Location: Ottawa Canada

PostPosted: Mon Jul 22, 2013 21:27    Post subject: Reply with quote
[quote="al_c"]
bpsmicro wrote:
Something odd happened today that I think isn't related. The Daily Usage wasn't being updated. I looked at my mac_data, and it's gotten corrupted for one specific IP. The second line for today looks like:

Code:
xx:xx:xx:xx:xx:xx,192.168.121.8,4060092
25525,76371
12735,20


And then there are a whack of other lines for the same IP, all broken. But interspersed are lines for different IPs that are okay. I assume the script is reading that line from somewhere, updating it, then rewriting it equally broken.

I've repaired the damage by deleting all the lines from today for that IP, but it got corrupted again quickly after, so I assume the file is being written by something that has corrupted data of its own. Rebooting the router didn't help.

Thoughts?


Brad sent me a log file and I'm 99% sure that I understand what's going on now.

In his log, just prior to the problem occurring, a new IP address (192.168.100.86) gets added to his network ... after that, he starts getting the odd errors for IP address 192.168.100.8

It appears that my regex is not sufficiently strict - i.e., when I'm looking for the upload/downloads for 192.168.100.8 I'm also getting those for 192.168.100.86 (hence the line breaks in the example above)

I think it the fix is as simple as changing the lines of code from
--- usageIn=`echo "$iptablesData" | awk '{print $2,$9}' | grep "$currentIP" | awk '{print $1}'`
--- usageOut=`echo "$iptablesData" | awk '{print $2,$8}' | grep "$currentIP" | awk '{print $1}'`
to
+++ usageIn=`echo "$iptablesData" | awk '{print $2,$9}' | grep "$currentIP " | awk '{print $1}'`
+++ usageOut=`echo "$iptablesData" | awk '{print $2,$8}' | grep "$currentIP " | awk '{print $1}'`


Note that I've simply added a space after `grep "$currentIP "`... if this does not work, the change is only slightly more complex - i.e., the regex looks for the current IP address followed by a non-numeric character.

I'll do what I can to test this on my router tonight and will post an updated version of the script shortly.

Al
Sponsor
Canadian Geek
DD-WRT Novice


Joined: 18 Jun 2013
Posts: 49

PostPosted: Mon Jul 22, 2013 23:25    Post subject: Reply with quote
OK. Got 1.0.5 working. I copied the config.file from 1.0.3 over my old file. Then edited it on the router. I must have screwed up the old config.file somehow. Anyway, it's working now. If it keeps working properly I'll stop running the old monitor software in parallel.

Jeff

One question, where are the entries kept if you do a "Add Correction"? I don't see them in the 01-07-2013-mac_data.html file.
Canadian Geek
DD-WRT Novice


Joined: 18 Jun 2013
Posts: 49

PostPosted: Tue Jul 23, 2013 0:59    Post subject: Reply with quote
Notice below how the text gets cut off by the pie chart. How can I correct this?


ScreenShot012.jpg
 Description:
 Filesize:  103.29 KB
 Viewed:  13474 Time(s)

ScreenShot012.jpg


spanman
DD-WRT User


Joined: 27 Sep 2008
Posts: 446
Location: Port Of Spain

PostPosted: Tue Jul 23, 2013 1:42    Post subject: Reply with quote
al_c said he will move the legend from there a few post back, wait for update
_________________
Buffalo WZR-600DHP - 23838
TP Link WDR3600 - 21676
Linksys WRT54G-TM - 12548 (NEWD Eko Mega)
al_c
DD-WRT Guru


Joined: 13 Apr 2013
Posts: 2134
Location: Ottawa Canada

PostPosted: Tue Jul 23, 2013 2:08    Post subject: Reply with quote
Canadian Geek wrote:
OK. Got 1.0.5 working. I copied the config.file from 1.0.3 over my old file. Then edited it on the router. I must have screwed up the old config.file somehow. Anyway, it's working now. If it keeps working properly I'll stop running the old monitor software in parallel.

Jeff

One question, where are the entries kept if you do a "Add Correction"? I don't see them in the 01-07-2013-mac_data.html file.


Jeff - glad to hear you got things up and running... One day when I get a few additional features added, I promise to get the installation notes updated.

Regarding the corrections, I cannot make updates within the usage files (JavaScript does not permit that over an HTTP connection). Instead, that information (along with all of the settings, etc.) is stored in `localStorage`... a relatively new HTML5 feature like cookies but with much greater capacity and much easier to update. For more info, see http://www.w3schools.com/html/html5_webstorage.asp

Hope this helps,

Al
asfd64
DD-WRT User


Joined: 13 Nov 2010
Posts: 59

PostPosted: Tue Jul 23, 2013 2:18    Post subject: Reply with quote
I just updated to 1.0.5 and my PS3 went from 6GB for the day to -2GB. I was able to change the html file and change the -2GB to 6GB. Since everything is running from /tmp and that gets wiped when you reboot does a shutdown save the data back to the USB (in my case /mnt) when you do a reboot?

Thanks
Ian
al_c
DD-WRT Guru


Joined: 13 Apr 2013
Posts: 2134
Location: Ottawa Canada

PostPosted: Tue Jul 23, 2013 2:29    Post subject: Reply with quote
asfd64 wrote:
I just updated to 1.0.5 and my PS3 went from 6GB for the day to -2GB. I was able to change the html file and change the -2GB to 6GB. Since everything is running from /tmp and that gets wiped when you reboot does a shutdown save the data back to the USB (in my case /mnt) when you do a reboot?

Thanks
Ian



Ian - I'm a little concerned that your usage went negative with v1.0.5. What router and version of DD-WRT are you running? Please set your loglevel to 1 in config.file and if it happens again, send me the data log for the day.

Your data should survive a shutdown but without seeing your config.file, its a little hard to say for sure. If you've used the defaults then yes it will get backed up and restored (and in fact if you've left _doDailyBU=1, then you'll also get a backup every day).

If you'd like, send me your config.file in a PM and I can take a look.

Al
asfd64
DD-WRT User


Joined: 13 Nov 2010
Posts: 59

PostPosted: Tue Jul 23, 2013 2:56    Post subject: Reply with quote
I'm running the following:
Router Model Linksys WRT600N v1.1
Firmware Version DD-WRT v24-sp2 (08/12/10) mega - build 14929

Here is my Config, I didn't change much except baseDir and billing day.

Code:
_monitoring=1 #permitted values: 1->running(*) || 0->stop
_paused=0 #permitted values: 0->no updates || 1->updates(*)
_updatefreq=10 #number of seconds between updates (* default 10sec)
_updateInterval=3 #number of intervals between updates of the usage data(* default 3)
_publishInterval=9 #number of intervals between updates for to the website (* default 3)
_baseDir="/mnt/YAMon/"
_dataDir="data/"
_logDir="logs/"
_wwwData="/tmp/www/data/"
_usageFileName="mac_data.html"
_usersFileName="users.file"
_usersFileNameWWW="users.html"
_enableLogging=1 #permitted values: 1->logging(*) || 0->no logging
_log2file=1 #permitted values: 0->screen || 1->file(*) || 2->both
_loglevel=1 #permitted values: 0->all(0) || 1->most || 2->serious only
_ispBillingDay=1 #rollover day of the month for ISP billing
_doDailyBU=1 #whether or not to make daily backups of user & usage data - values: 1-->Yes(*) || 0->No
_dailyBUPath="daily bu/" #only required if doDailyBU == 1
asfd64
DD-WRT User


Joined: 13 Nov 2010
Posts: 59

PostPosted: Tue Jul 23, 2013 3:15    Post subject: Reply with quote
It might have just been the way I upgraded. 1.0.4 was running on the router and I copied over the new files and did a reboot from the telnet session. Maybe because 1.0.4 was still running on the router it caused the negative number. I'll run with 1.0.5 and see if it happens again, I have logging enabled just in case.

Ian
al_c
DD-WRT Guru


Joined: 13 Apr 2013
Posts: 2134
Location: Ottawa Canada

PostPosted: Tue Jul 23, 2013 3:18    Post subject: Reply with quote
asfd64 wrote:
I'm running the following:
Router Model Linksys WRT600N v1.1
Firmware Version DD-WRT v24-sp2 (08/12/10) mega - build 14929

Here is my Config, I didn't change much except baseDir and billing day.

Code:
_monitoring=1 #permitted values: 1->running(*) || 0->stop
_paused=0 #permitted values: 0->no updates || 1->updates(*)
_updatefreq=10 #number of seconds between updates (* default 10sec)
_updateInterval=3 #number of intervals between updates of the usage data(* default 3)
_publishInterval=9 #number of intervals between updates for to the website (* default 3)
_baseDir="/mnt/YAMon/"
_dataDir="data/"
_logDir="logs/"
_wwwData="/tmp/www/data/"
_usageFileName="mac_data.html"
_usersFileName="users.file"
_usersFileNameWWW="users.html"
_enableLogging=1 #permitted values: 1->logging(*) || 0->no logging
_log2file=1 #permitted values: 0->screen || 1->file(*) || 2->both
_loglevel=1 #permitted values: 0->all(0) || 1->most || 2->serious only
_ispBillingDay=1 #rollover day of the month for ISP billing
_doDailyBU=1 #whether or not to make daily backups of user & usage data - values: 1-->Yes(*) || 0->No
_dailyBUPath="daily bu/" #only required if doDailyBU == 1


Ian - back to your previous question. Yes your data will survive when your router restarts.

Look in `/mnt/YAMon/data/` and you'll see your user and usage data files
the usage file is updated in this location every 30 sec and is 'published to the web server every 90 sec.
The user file is checked every 10 seconds and published to the web whenever a change is detected

Both files also get backed up at midnight of everyday to `/mnt/YAMon/daily bu/`

Assuming that you've added the startup script to your router (Administration-->Commands), then the script will read the latest values from `/mnt/YAMon/data/`

I hope this helps,

Al
Canadian Geek
DD-WRT Novice


Joined: 18 Jun 2013
Posts: 49

PostPosted: Tue Jul 23, 2013 3:25    Post subject: Reply with quote
Thanks Al. I was hoping my boys would be able to see any updates. Next month should be more accurate since it will be from the beginning of the month. Anyway, since I started running monitoring software on the router and showing them who was using what (ie, who's computer, xbox or phone was doing what), downloads are down significantly. Gee, I wonder why? Very Happy

Jeff
asfd64
DD-WRT User


Joined: 13 Nov 2010
Posts: 59

PostPosted: Tue Jul 23, 2013 22:52    Post subject: Reply with quote
I got another negative value today, I sent you my log in a pm.

Thanks!
spanman
DD-WRT User


Joined: 27 Sep 2008
Posts: 446
Location: Port Of Spain

PostPosted: Tue Jul 23, 2013 22:58    Post subject: Reply with quote
al_c like version 1.05 only solved my negative values.
_________________
Buffalo WZR-600DHP - 23838
TP Link WDR3600 - 21676
Linksys WRT54G-TM - 12548 (NEWD Eko Mega)
asfd64
DD-WRT User


Joined: 13 Nov 2010
Posts: 59

PostPosted: Tue Jul 23, 2013 23:04    Post subject: Reply with quote
I installed 1.0.5 yesterday but I got a new one today
pyThat
DD-WRT Novice


Joined: 28 Jul 2012
Posts: 34

PostPosted: Wed Jul 24, 2013 10:44    Post subject: Reply with quote
I'm using YAMon 1.0.5 on new device which is Buffalo WBMR-HP-G300H "it's a modem", build 21676 and it's working like charm.
Goto page Previous  1, 2, 3 ... , 40, 41, 42  Next Display posts from previous:    Page 41 of 42
Post new topic   This topic is locked: you cannot edit posts or make replies.    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum