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, 4 ... 40, 41, 42  Next
Author Message
bpsmicro
DD-WRT User


Joined: 07 Oct 2010
Posts: 180

PostPosted: Fri Oct 29, 2010 12:55    Post subject: Reply with quote
Now we're cooking. Things seem to be progressing smoothly now. I'll monitor for a day'ish, then upgrade to your latest script and make sure it stays working.

Brad.
Sponsor
FezJay
DD-WRT User


Joined: 11 Sep 2010
Posts: 178

PostPosted: Fri Oct 29, 2010 14:15    Post subject: Reply with quote
bpsmicro wrote:
Now we're cooking. Things seem to be progressing smoothly now. I'll monitor for a day'ish, then upgrade to your latest script and make sure it stays working.

Brad.


Oh good :-)

You will be happy to know that I have revamped my setup wiki page based on the issues found recently with my setup instructions.

http://code.google.com/p/lal-projects/wiki/bw_monitor_setup

I have alot more detail about the script arguments and how they are used.

Hope it clears a few things up.

A

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

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


Joined: 08 Jun 2008
Posts: 81

PostPosted: Fri Oct 29, 2010 19:21    Post subject: Reply with quote
dont work for me.

/tmp/smbshare/bw_monitor.sh 10 3 10 1 /tmp/smbshare/users.txt /tmp/smbshare/mac_usage.backup /tmp/smbshare/history/ /tmp/smbshare/mac_usage.db '' 1 1 1 1 1


user_details.js is generate fine on /tmp/www and found on monitor.html. mac_usage.db and mac_usage.backup are generated fine too with the stats, but monitor.html never show me any information.

_________________
My Blog
wrt54GL 1.1 -> Resurrected eko 14471/MMC Mod
E2000 (wrt320n converted) 1.0 -> BS 15962M -> Resurrected WAN<Serial> BS r23919
RT-AC56U -> Merlin 374.42_2
yzy-oui-fi
DD-WRT Guru


Joined: 03 Mar 2009
Posts: 2826
Location: France

PostPosted: Fri Oct 29, 2010 19:41    Post subject: Reply with quote
try this


Code:
sh /tmp/smbshare/bw_monitor.sh 10 3 10 1 /tmp/smbshare/users.txt /tmp/smbshare/mac_usage.backup /tmp/smbshare/history/ /tmp/smbshare/mac_usage.db '' 1 1 1 1 1

_________________
DD-WRT WDS MESH + DASHBOARD (fr), DD-WRT network setting tool (tools.yzy-oui-fi.com), Wifi Business and IT guy After hours, My Blog, Free DD-WRT VPN Community(www.wrt-pptp-ww.com), DD-WRT pré-réglés pour réseau outdoor(hotspot.yzy-oui-fi.com), Nouveau Forum DD-WRT francophone
Theliel
DD-WRT User


Joined: 08 Jun 2008
Posts: 81

PostPosted: Fri Oct 29, 2010 22:58    Post subject: Reply with quote
nothing...
_________________
My Blog
wrt54GL 1.1 -> Resurrected eko 14471/MMC Mod
E2000 (wrt320n converted) 1.0 -> BS 15962M -> Resurrected WAN<Serial> BS r23919
RT-AC56U -> Merlin 374.42_2
FezJay
DD-WRT User


Joined: 11 Sep 2010
Posts: 178

PostPosted: Sat Oct 30, 2010 0:23    Post subject: Reply with quote
IS there a user_details.js file being created?

If it is how do you browse to it via a browser.

At the moment, the monitor.html is referring to it via http://192.168.1.1/user/user_details.js

If this is not correct for your setup, you will need to modify the above to your router/web server IP etc.

Is there any information in the usage file or the js file?

If you are using Mozilla, javascript errors will not display (unless you have them turned out).

What version are you using as well?

I am in the process of making this an optional input parameter, which if not supplied will default to http://192.168.1.1/users/user_details.js

This will be in version 0.9.

A

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

Optware (jffs/mnt) 4GB Flash Drive


Last edited by FezJay on Sat Oct 30, 2010 1:18; edited 1 time in total
Theliel
DD-WRT User


Joined: 08 Jun 2008
Posts: 81

PostPosted: Sat Oct 30, 2010 1:01    Post subject: Reply with quote
Yes, monitor.html was edit to correct IP, how I said, user_details.js its generated correctly on /tmp/www and accessible from my web interface.

Anyway, the content of js generated dont change, the whole content of file in this moment:

todaysDay=30; var users=[];


So far no errors on FF (and JS console) or IE. usage files (bckup, mac_usage...) appear contain the correct data.


Im using your latest file versions, maybe i should test old builds.

_________________
My Blog
wrt54GL 1.1 -> Resurrected eko 14471/MMC Mod
E2000 (wrt320n converted) 1.0 -> BS 15962M -> Resurrected WAN<Serial> BS r23919
RT-AC56U -> Merlin 374.42_2
FezJay
DD-WRT User


Joined: 11 Sep 2010
Posts: 178

PostPosted: Sat Oct 30, 2010 1:08    Post subject: Reply with quote
Also, make sure that the users.txt file that you are using is in the correct format.

MAC,IP,NAME,TYPE

The MAC must be formatted with : NOT -.

The first time the JS file is created, it will take a bit longer as I need to generate it from ground up.

Subsequesnt updates are much faster as I can use grep and SED to manipulate the files.

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: 178

PostPosted: Sat Oct 30, 2010 1:31    Post subject: Reply with quote
Theliel wrote:
Yes, monitor.html was edit to correct IP, how I said, user_details.js its generated correctly on /tmp/www and accessible from my web interface.

Anyway, the content of js generated dont change, the whole content of file in this moment:

todaysDay=30; var users=[];


So far no errors on FF (and JS console) or IE. usage files (bckup, mac_usage...) appear contain the correct data.


Im using your latest file versions, maybe i should test old builds.


Your all good.

Is that the ONLY line in the JS file?

If it is, then I would check your users.txt file.

It goes through this file, and matches it up against the usage file.

If there are not entries such as

todaysDay=30; var users=[]; User0=new Object(); User0.ID='Chris'; User0.userUsage=[]; MAC701A04D1ABF2= new Object(); MAC701A04D1ABF2.ID='PC'; MAC701A04D1ABF2.dayUsages=[]; MAC701A04D1ABF201= new Object();
MAC701A04D1ABF201.down=0;
MAC701A04D1ABF201.up=0;
MAC701A04D1ABF2.dayUsages[0]=MAC701A04D1ABF201; MAC701A04D1ABF202= new Object();
MAC701A04D1ABF202.down=0;
MAC701A04D1ABF202.up=0;
MAC701A04D1ABF2.dayUsages[1]=MAC701A04D1ABF202; MAC701A04D1ABF203= new Object();
... up to MAC701A04D1ABF2.dayUsages[31]

Then it would appear I am not able to retrieve user information.

Can you try this on your route command line.

sed -n "1"'p' /tmp/smbshare/users.txt

What this should pull out is the very first user line.

Im assuming every version of dd-wrt contains grep and sed support (actually hoping)

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

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


Joined: 08 Jun 2008
Posts: 81

PostPosted: Sat Oct 30, 2010 1:48    Post subject: Reply with quote
Yes, sed work fine and retrieve correctly the first line:

00:xx:xx:xx:xx:xx,192.168.2.2,Theliel,Theliel

The same problem with /tmp/dnsmasq.conf

_________________
My Blog
wrt54GL 1.1 -> Resurrected eko 14471/MMC Mod
E2000 (wrt320n converted) 1.0 -> BS 15962M -> Resurrected WAN<Serial> BS r23919
RT-AC56U -> Merlin 374.42_2
FezJay
DD-WRT User


Joined: 11 Sep 2010
Posts: 178

PostPosted: Sat Oct 30, 2010 1:59    Post subject: Reply with quote
Delete the JS file and let the script try and re-create it. You do not need to restert the script, the system checks every time make sure one exists or not.

I get the feeling that it didnt have access to the user.txt file before the script was started.

So it created the JS file, and every next update couldnt find an entry so stepped over it.

Ah wait, have you got sort functionality (Option 11)?

try this

sort -t, +2 -3 /tmp/smbshare/users.txt

If this doesnt work try changing that option to 0 (atm you have it set to 1).

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: 178

PostPosted: Sat Oct 30, 2010 2:10    Post subject: Reply with quote
Theliel wrote:
Yes, sed work fine and retrieve correctly the first line:

00:xx:xx:xx:xx:xx,192.168.2.2,Theliel,Theliel

The same problem with /tmp/dnsmasq.conf


The issue that you are having is, its not getting into the loop.

It fails straight away. It basically saying that there is NO clients to process.

As I mentioned before, somthing has gone wrong with how it determines the source users from the users.txt file.

Im pretty sure it has to be one of those commands failing.

grep, sed, or sort.

My money is on sort as I know not every version of dd-wrt supports it. Thats why I specifically gave the option to turn it off and on.

NOTE: If you chose to NOT use sort, then you will need to sort the users.txt file manullay to get that nice grouping that I have achieved Wink.

e.g.

00:xx:xx:xx:xx:xx,192.168.2.2,Theliel,PC
01:xx:xx:xx:xx:xx,192.168.2.3,Theliel,Laptop

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

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


Joined: 08 Jun 2008
Posts: 81

PostPosted: Sat Oct 30, 2010 2:18    Post subject: Reply with quote
shit, eureka!!

sort dont work for some reason, If I invoke sort manually response with a "illegal option -- 3".

Work fine now Smile thank, Im was very interested on some utils like this.

Im experimenting some issues, for example some clients are added automatically to my users.txt regardless if their exist on list or not. I going to play a little with this and maybe tomorrow i can tell you more (sorry, here are 4:17 am and I need to sleep something)

Good work.

_________________
My Blog
wrt54GL 1.1 -> Resurrected eko 14471/MMC Mod
E2000 (wrt320n converted) 1.0 -> BS 15962M -> Resurrected WAN<Serial> BS r23919
RT-AC56U -> Merlin 374.42_2
FezJay
DD-WRT User


Joined: 11 Sep 2010
Posts: 178

PostPosted: Sat Oct 30, 2010 2:24    Post subject: Reply with quote
LOL

Yeah that adding of clients is a feature ;-)

I do that. Basically I add any MAC that does not exist in your users.txt file.

This is because I wanted to make sure veryone gets countered and I get warned if some one I dont know is using the internet.

Ill make this optional in the future 0.9 maybe ;-)

Oh shit, have you got awk support?

awk '{print $1}' users.txt (I forgot the full path)

A

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

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


Joined: 08 Jun 2008
Posts: 81

PostPosted: Sat Oct 30, 2010 2:37    Post subject: Reply with quote
yes, awk work fine, im using this on some scripts

add other clients to the list its fine, the problem are some client that already exist on list are added too with MAC 00:00:00:00:00:00, but with a correct and existing IP.

_________________
My Blog
wrt54GL 1.1 -> Resurrected eko 14471/MMC Mod
E2000 (wrt320n converted) 1.0 -> BS 15962M -> Resurrected WAN<Serial> BS r23919
RT-AC56U -> Merlin 374.42_2
Goto page Previous  1, 2, 3, 4 ... 40, 41, 42  Next Display posts from previous:    Page 3 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