dd-wrt - Bandwidth Usage Monitor

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Goto page Previous  1, 2, 3 ... 17, 18, 19 ... 40, 41, 42  Next
Author Message
orionshock
DD-WRT Novice


Joined: 29 Apr 2011
Posts: 43

PostPosted: Mon May 02, 2011 10:06    Post subject: Reply with quote
munzab wrote:
fezjay, do you know of a way to manually reset the usage data?problem is since it did not reset at the start of the month, it is adding download amount to what was already known, therefore making twice as much being used?


I think I know why it's not reseting on time.. the month isn't stored as part of the usage file. So when it's evaluated, there is no point of reference of when it happened.

For right now, you can just manually backup (move) the usage file to somewhere else & that will reset it. remember to give it some time before it's reflected on the monitor.

Also Im finding that bandwidth data is being mis-attributed. I uploaded ~20mb to dropbox from my android phone as part of a backup & it called it download traffic instead of upload.
Sponsor
kublai
DD-WRT User


Joined: 03 Mar 2007
Posts: 107

PostPosted: Mon May 02, 2011 11:44    Post subject: Multiple instances of bw_monitor.sh Reply with quote
Whenever my router reboot it get multiple instances of bw_montior.sh running. How can I fix this?
FezJay
DD-WRT User


Joined: 11 Sep 2010
Posts: 176

PostPosted: Tue May 03, 2011 9:21    Post subject: Reply with quote
munzab wrote:
fezjay, do you know of a way to manually reset the usage data?problem is since it did not reset at the start of the month, it is adding download amount to what was already known, therefore making twice as much being used?


would you have a look at this and let me know if i set it up correctly to reset on the 01 of every month?



I have had a look and I have found the problem Wink

I was not working out the next day correctly, or to be more precise, the first day of a new month.

Basically it was skipping the first day, if you had your reset day at 2, would have worked fine lol.

I have made the fix and have checked it in.

_________________
dd-wrt eko/V24-K26 15508
Belkin F7D4301
8MB Flash
64MB RAM

Optware (jffs/mnt) 4GB Flash Drive
FezJay
DD-WRT User


Joined: 11 Sep 2010
Posts: 176

PostPosted: Tue May 03, 2011 9:24    Post subject: Re: Multiple instances of bw_monitor.sh Reply with quote
kublai wrote:
Whenever my router reboot it get multiple instances of bw_montior.sh running. How can I fix this?


You should have about 2 I think that will be running.

One instance is for the bulk of the data retrieval and writing data out, the other instance is for monitoring new clients and setting up your IP table rules etc.

If your seeing more let me know and send me your startup script.

Sorry, I misread your post, mmmm, have you got the shutdown scripts in place that force the monitor to shutdown?


Cheers

A

_________________
dd-wrt eko/V24-K26 15508
Belkin F7D4301
8MB Flash
64MB RAM

Optware (jffs/mnt) 4GB Flash Drive
FezJay
DD-WRT User


Joined: 11 Sep 2010
Posts: 176

PostPosted: Tue May 03, 2011 9:29    Post subject: Reply with quote
orionshock wrote:


Also Im finding that bandwidth data is being mis-attributed. I uploaded ~20mb to dropbox from my android phone as part of a backup & it called it download traffic instead of upload.


Lets have a look at your startup script.

I have been running that same script on my router for a few months now, and the only issue I have had is with the router removing my damn mnt folder after a reboot.

But back to your question, I have not seen this download/upload issue.

I can only assume that for some reason the IP tables data is being retrieved differently.

Let me know if it continues like this.

A

_________________
dd-wrt eko/V24-K26 15508
Belkin F7D4301
8MB Flash
64MB RAM

Optware (jffs/mnt) 4GB Flash Drive
FezJay
DD-WRT User


Joined: 11 Sep 2010
Posts: 176

PostPosted: Tue May 03, 2011 9:34    Post subject: Reply with quote
orionshock wrote:
@FezJay

Been running the script w/o problems for about a week now.. however the log is spitting up this as of recent.
Not sure if it's recent, but i'll keep an eye out for other things that could be causing it.

Code:


2011-05-01 23:49:40: ***publishUsage***
2011-05-01 23:49:40: ***updateJavascript***
sed: -e expression #1, char 0: no previous regular expression
sed: -e expression #1, char 0: no previous regular expression
sed: -e expression #1, char 0: no previous regular expression
sed: -e expression #1, char 0: no previous regular expression
sed: -e expression #1, char 0: no previous regular expression
sed: -e expression #1, char 0: no previous regular expression
2011-05-01 23:50:11: ***updateUsage***
2011-05-01 23:50:11: IPTABLES DATA



That tends to occur with empty input into it.

I'm trying to get some data that might not exist, can happen with a new client or day etc.

A

_________________
dd-wrt eko/V24-K26 15508
Belkin F7D4301
8MB Flash
64MB RAM

Optware (jffs/mnt) 4GB Flash Drive
orionshock
DD-WRT Novice


Joined: 29 Apr 2011
Posts: 43

PostPosted: Tue May 03, 2011 9:36    Post subject: Reply with quote
FezJay wrote:
orionshock wrote:


Also Im finding that bandwidth data is being mis-attributed. I uploaded ~20mb to dropbox from my android phone as part of a backup & it called it download traffic instead of upload.


Lets have a look at your startup script.

I have been running that same script on my router for a few months now, and the only issue I have had is with the router removing my damn mnt folder after a reboot.

But back to your question, I have not seen this download/upload issue.

I can only assume that for some reason the IP tables data is being retrieved differently.

Let me know if it continues like this.

A


oddly enough, I was attempting to figure out why / how the script worked so it would also monitor my wireless guest network ( running a different dhcp range and bridge ). So my adjustments might be to blame for the problems i ran into.

However, having an itch to scratch for my own interest, i rewrote the .sh script in Lua (as it is a language I am familiar with). Next thing i need to do is redo the monitor.html file to use the new JS table format.
FezJay
DD-WRT User


Joined: 11 Sep 2010
Posts: 176

PostPosted: Tue May 03, 2011 9:37    Post subject: Reply with quote
kublai wrote:
Same for me 1st of month and it didn't reset. I changed the 4th parameter from 4 to 1.

munzab wrote:
Just a heads up - 1st of may, the monitor did not reset again.

any ideas what to do?


Kublai, did you get it all working?

I will just mention that the script you saw on the last page was for those users that do not have a USB or external storage.

If you have external storage things get a bit cleaner Wink

Wiki site explains a lot about it.

A

_________________
dd-wrt eko/V24-K26 15508
Belkin F7D4301
8MB Flash
64MB RAM

Optware (jffs/mnt) 4GB Flash Drive
FezJay
DD-WRT User


Joined: 11 Sep 2010
Posts: 176

PostPosted: Tue May 03, 2011 9:41    Post subject: Reply with quote
orionshock wrote:
Update.

OK, solved problem from previous post. made a blank users.file with a all 0's mac and ip. It picked up the rest all ok & it is now working as intended for me Smile

2nd problem, reading though the code and output.. it only monitors 1 bridge "br0". while for the vast majority this works well... i need it to monitor wlan0.1 as well because I'm running a guest network on 192.168.2.1 and those IP's are not part of br0.


Have to be honest with you orion, my knowledge of IP tables and rules is enough to get this working with br0.

I am not sure the impact that placing rules on the wlan would have or if its even possible.

Ill have a look mate.

A

_________________
dd-wrt eko/V24-K26 15508
Belkin F7D4301
8MB Flash
64MB RAM

Optware (jffs/mnt) 4GB Flash Drive
kublai
DD-WRT User


Joined: 03 Mar 2007
Posts: 107

PostPosted: Tue May 03, 2011 10:29    Post subject: Reply with quote
I got it working thanks, but I have a couple questions.

1. The script does not reset data usage at the begnning of the month.

2. Can the user_detils.js be run from the usb drive? I gave it dir in the 9th position and the use_detail.js file was created but will not update the 192.168.xx.xx/user/monitor.html age. When it's in /tmp/www then the status is updated.


FezJay wrote:
kublai wrote:
Same for me 1st of month and it didn't reset. I changed the 4th parameter from 4 to 1.

munzab wrote:
Just a heads up - 1st of may, the monitor did not reset again.

any ideas what to do?


Kublai, did you get it all working?

I will just mention that the script you saw on the last page was for those users that do not have a USB or external storage.

If you have external storage things get a bit cleaner Wink

Wiki site explains a lot about it.

A
FezJay
DD-WRT User


Joined: 11 Sep 2010
Posts: 176

PostPosted: Tue May 03, 2011 13:56    Post subject: Reply with quote
[quote="kublai"]I got it working thanks, but I have a couple questions.

1. The script does not reset data usage at the begnning of the month.

2. Can the user_detils.js be run from the usb drive? I gave it dir in the 9th position and the use_detail.js file was created but will not update the 192.168.xx.xx/user/monitor.html age. When it's in /tmp/www then the status is updated.


I have had a look and I have found the problem

I was not working out the next day correctly, or to be more precise, the first day of a new month.

Basically it was skipping the first day, if you had your reset day at 2, would have worked fine lol.

I have made the fix and have checked it in.

In regards to your second question, the js file needs to be publicly available to the web page.

Technically, you can set up a web server that points to a directory on your flash drive. Allowing you to then save and read the js file from there.

_________________
dd-wrt eko/V24-K26 15508
Belkin F7D4301
8MB Flash
64MB RAM

Optware (jffs/mnt) 4GB Flash Drive
kublai
DD-WRT User


Joined: 03 Mar 2007
Posts: 107

PostPosted: Tue May 03, 2011 14:12    Post subject: Reply with quote
Looking forward to the month end data usage clear fix. Thanks for the great script.

[quote="FezJay"]
kublai wrote:
I got it working thanks, but I have a couple questions.

1. The script does not reset data usage at the begnning of the month.

2. Can the user_detils.js be run from the usb drive? I gave it dir in the 9th position and the use_detail.js file was created but will not update the 192.168.xx.xx/user/monitor.html age. When it's in /tmp/www then the status is updated.


I have had a look and I have found the problem

I was not working out the next day correctly, or to be more precise, the first day of a new month.

Basically it was skipping the first day, if you had your reset day at 2, would have worked fine lol.

I have made the fix and have checked it in.

In regards to your second question, the js file needs to be publicly available to the web page.

Technically, you can set up a web server that points to a directory on your flash drive. Allowing you to then save and read the js file from there.
ultm8m
DD-WRT Novice


Joined: 03 May 2011
Posts: 3

PostPosted: Tue May 03, 2011 15:04    Post subject: Reply with quote
Hi there,

My setup is dd-wrt v.24 running on a wrt54gl.
I mounted /vffs/ to a samba/network drive.

Everything seems to be running fine. The log file shows the packets and data consumption correctly for each device on the network.

The issue I am having is that the generated JS file includes no bandwidth data. It includes all the hosts/devices correctly, but no bandwidth usage stats.

I was wondering if someone knew why this would be happening?

Everything seems to be running fine, the JS file even updates when a new device is auto-added to the list.

Thanks, I appreciate the help.
ultm8m
FezJay
DD-WRT User


Joined: 11 Sep 2010
Posts: 176

PostPosted: Wed May 04, 2011 9:36    Post subject: Reply with quote
ultm8m wrote:
Hi there,

My setup is dd-wrt v.24 running on a wrt54gl.
I mounted /vffs/ to a samba/network drive.

Everything seems to be running fine. The log file shows the packets and data consumption correctly for each device on the network.

The issue I am having is that the generated JS file includes no bandwidth data. It includes all the hosts/devices correctly, but no bandwidth usage stats.

I was wondering if someone knew why this would be happening?

Everything seems to be running fine, the JS file even updates when a new device is auto-added to the list.

Thanks, I appreciate the help.
ultm8m


Run the following commad.

iptables -L BWMON -vnx

Let me know that you are getting information and that the bytes figures are being cleared.

Then check the /tmp/ folder for the mac_usage file and ensure its been updated and it has figures.

If that is all working, you may need to check that you have the required packages installed (see wiki site)

Let me know how you get on.

A

_________________
dd-wrt eko/V24-K26 15508
Belkin F7D4301
8MB Flash
64MB RAM

Optware (jffs/mnt) 4GB Flash Drive
munzab
DD-WRT Novice


Joined: 06 Feb 2011
Posts: 29

PostPosted: Wed May 04, 2011 10:18    Post subject: Reply with quote
[quote="FezJay"]
kublai wrote:
I got it working thanks, but I have a couple questions.

1. The script does not reset data usage at the begnning of the month.

2. Can the user_detils.js be run from the usb drive? I gave it dir in the 9th position and the use_detail.js file was created but will not update the 192.168.xx.xx/user/monitor.html age. When it's in /tmp/www then the status is updated.


I have had a look and I have found the problem

I was not working out the next day correctly, or to be more precise, the first day of a new month.

Basically it was skipping the first day, if you had your reset day at 2, would have worked fine lol.

I have made the fix and have checked it in.

In regards to your second question, the js file needs to be publicly available to the web page.

Technically, you can set up a web server that points to a directory on your flash drive. Allowing you to then save and read the js file from there.




where should i see the change?should i download a new wrtbwmon script file and just overwrite the one i have in the router already and not change anything in the startup script?
Goto page Previous  1, 2, 3 ... 17, 18, 19 ... 40, 41, 42  Next Display posts from previous:    Page 18 of 42
Post new topic   Reply to topic    DD-WRT Forum 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