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 ... 30, 31, 32 ... 40, 41, 42  Next
Author Message
Lights_On
DD-WRT User


Joined: 21 Jul 2012
Posts: 53

PostPosted: Tue Jul 24, 2012 8:29    Post subject: Same set up twice - only one works? Reply with quote
Hi All,

Many thanks for this software and all support - very impresive stuff.

I have the set up working like a charm at home and have an identical set up at work - saly however my work set up is not populating with data? as I say both are same routers and same firmware and same set up through out - only difference is one is static IP and one is DHCP. any reason why one may not be poplulating the .html with data?

Also has anyone managed to send an email at month end with the statics before the reset takes place? this would be realy usefull and there is a working sendmail fuction in busy box - sadly however I would have no idea how to code this into the script.

My set up is:
V1.2 of BW_Monitor
WRT610n V1
DD-WRT v24-sp2 (10/13/10) mega - build 15453M NEWD-2 K2.6 Eko
Sponsor
Lights_On
DD-WRT User


Joined: 21 Jul 2012
Posts: 53

PostPosted: Wed Jul 25, 2012 21:30    Post subject: Reply with quote
hi Again,

it appears it is not creationg the user_deatail.js

any thoughts on how i might try to fix this.

have tried hard reset and set up again from fresh and end up in the same place - odd?

any thoughts welcome and apreciated.
wooly
DD-WRT Novice


Joined: 06 May 2009
Posts: 29

PostPosted: Thu Jul 26, 2012 0:28    Post subject: Reply with quote
Go into the directory where user_deatail.js should be and do a "ls -all"

You may see a wholes series of ???????? where date and time etc should be. If that is the case then delete the file and it should get rebuilt after a reboot.
Lights_On
DD-WRT User


Joined: 21 Jul 2012
Posts: 53

PostPosted: Thu Jul 26, 2012 8:00    Post subject: Reply with quote
Hi Wooly,

thnak yuo so much for taking the time to reply I am very greatfull. 3 solid days working on this and no luck - I must be mad!

did ls -all in the /tmp/www where the user_deatail.js should be and got the below responce:

total 28
drwxr-xr-x 2 root root 0 Jul 25 22:27 .
drwxrwxrwx 9 root root 0 Jul 26 08:49 ..
-rw-r--r-- 1 root root 27075 Jul 25 22:27 monitor.html


I also am not getting the mac_usage.backup file being created in opt/monitor as I would on the other set up?

I am on a static IP on the machine that is not working - does this make a difference? the router is still 192.168.1.1

do i need to create a users.txt file?

also if i run the bw_monitor.sh i get the following at the end:

(more output before here but that all seems normal)...

Arg 16 Show MAC; Indicates if MAC addresses should be shown on the display
+ rm -f /tmp/monitor-started.lock
+ [ -n ]
+ [ -n ]
+ [ -n ]
+ [ -n ]
+ [ -n ]
+ [ -n ]
+ [ -n ]
+ [ -n ]
+ [ -z ]
+ [ -n ]
+ _macUsageFilePath=/tmp/mac_usage.db
+ [ -z ]
+ [ -n ]
+ _javascriptPath=/tmp/www/
+ [ 1 -eq 1 ]
+ [ /tmp/mac_usage.db = 1 ]
+ cp -f /tmp/mac_usage.db
missing destination file operand after `/tmp/mac_usage.db'
Try `cp --help' for more information.
+ echo
+ grep -i dnsmasq
+ isDNSMASQFilePath=
+ [ -n ]
+ [ -n ]
+ cat

Hope this helps offer some extra details for you and thnak you again to you Wooly and any one else who can offer some support in trouble shooting this.
wooly
DD-WRT Novice


Joined: 06 May 2009
Posts: 29

PostPosted: Thu Jul 26, 2012 20:56    Post subject: Reply with quote
Hi, sorry but I am no expert on this, I just muddled my way through until I got the result I wanted! However a couple of things to note:

If I do an ls -all /mnt/www I get

Code:
total 440
drwxrwxrwx  9 root root   4096 Jul 26 16:20 .
drwxr-xr-x 10 root root   4096 Jun 22 19:38 ..
drwxr-xr-x  2 root root   4096 Jul 15 12:35 backup
drwxr-xr-x  2 root root   4096 May 11 12:55 images
drwxr-xr-x  2 root root   4096 May 11 12:55 js
drwxr-xr-x  2 root root   4096 May 11 12:55 libs
drwxr-xr-x  2 root root   4096 May 11 12:55 logs
-rw-r--r--  1 root root  28895 Jul 22 16:02 monitor.html
-rwxr-xr-x  1 root root    119 May 11 12:55 mypage.live.asp
-rwxr-xr-x  1 root root    569 May 11 12:55 mypage.todo
-rwxr-xr-x  1 root root  16778 May 11 12:55 mypage1.sh
-rwxr-xr-x  1 root root  11982 May 11 12:55 mypage10.sh
-rwxr-xr-x  1 root root  13990 May 11 12:55 mypage11.sh
-rwxr-xr-x  1 root root  14279 May 11 12:55 mypage12.sh
-rwxr-xr-x  1 root root   8126 May 11 13:43 mypage13.sh
-rwxr-xr-x  1 root root  12851 May 11 12:55 mypage2.sh
-rwxr-xr-x  1 root root  14688 May 11 12:55 mypage3.sh
-rwxr-xr-x  1 root root  12789 May 11 12:55 mypage4.sh
-rwxr-xr-x  1 root root  14728 May 11 12:55 mypage5.sh
-rwxr-xr-x  1 root root  11159 May 11 12:55 mypage6.sh
-rwxr-xr-x  1 root root  13636 May 11 12:55 mypage7.sh
-rwxr-xr-x  1 root root  12895 May 11 12:55 mypage8.sh
-rwxr-xr-x  1 root root  11655 May 11 12:55 mypage9.sh
-rwxr-xr-x  1 root root   1662 May 11 12:55 reset.sh
drwxr-xr-x  4 root root   4096 May 11 12:55 setup
drwxr-xr-x  2 root root   4096 May 11 12:55 style
-rw-r--r--  1 root root 159944 Jul 26 16:20 user_details.js
-rwxr-xr-x  1 root root    922 Jul 22 13:13 users.file
lrwxrwxrwx  1 root root      8 Apr 23 16:38 www -> /mnt/www

and ls -all /mnt/monitor gives
Code:

total 64
drwxr-xr-x  4 root root  4096 Jul 25 21:50 .
drwxr-xr-x 10 root root  4096 Jun 22 19:38 ..
-rwxr-xr-x  1 root root 29031 May 11 12:56 bw_monitor.sh
-rwxr-xr-x  1 root root   442 May 11 12:56 bw_monitor_shutdown.sh
-rwxr-xr-x  1 root root  1561 Jul 21 17:07 bw_monitor_startup.sh
drwxr-xr-x  2 root root  4096 Jul 21 17:48 history
drwxr-xr-x  2 root root  4096 Jul 13 17:17 logs
-rwxrwxr-x  1 root root  2257 Jul 26 16:37 mac_usage.db
-rwxrwxr-x  1 root root  1448 Jul 25 21:48 users.file


My first guess is that there is a mixup in the directories specified, I remember I had to do some linking of directories as shown by:

lrwxrwxrwx 1 root root 8 Apr 23 16:38 www -> /mnt/www

in the first listing.

It may be worth doing a search for mac_usage.db and user_detail.js to see if they exist elsewhere

I think the lack of mac_usage.backup is due to the error shown when you run bw_monitor.sh i.e. missing destination file operand after `/tmp/mac_usage.db'

Somewhere around line 749 in that file you should see the following code, it looks as though part of it is missing.

Code:
if [ $_doUsageFileRestore -eq 1 ]; then
   [ "$_macUsageFilePath" = "1" ] && _macUsageData=`cat $_backupUsageFilePath` || cp -f $_backupUsageFilePath $_macUsageFilePath


Hope the above may help, if the problem still exists I can PM you my files, or you can send me yours and see if there are any obvious errors.

wooly
Lights_On
DD-WRT User


Joined: 21 Jul 2012
Posts: 53

PostPosted: Sat Jul 28, 2012 22:05    Post subject: Reply with quote
Hi Wooly,

Many thnaks again for your kind help.

Althought i dont know which setting in the router it must have been a setting in the router along with the need for a reflash did it.

I used the same .bin i had for my home router that was already pre-installed on the work router that was not working - anyway i reflashed the work router and then loaded on a back up of the working home router - adjusted the seeting required - and hey preseto - all worked. who know what setting was wrong...? never mind.

2 quick questions for you:

1) the (now working but before broken) set up does not seem to pick us new conections to the network - i have to make sure they are in the MAC tacble on the router for them to be shown in the monitor.html - any thought on why this might be? idfealy you want all ip's on the network to be found and "auto added" as i have on my other set up.

2)I notice you must be using "myPay" - do you have your bw-Monitor setupin mypage? if so have you got any pointers as I thought this was only possible with bwmon not the one here in this thread bw_Monitor.sh.

Mnay thnaks wooly - and all.

Regards
-Light_On
wooly
DD-WRT Novice


Joined: 06 May 2009
Posts: 29

PostPosted: Mon Jul 30, 2012 17:00    Post subject: Reply with quote
Whooooops Embarassed

Glad you got it working. My apologies, I was referring to bwmon......my mistake!
yman
DD-WRT Novice


Joined: 05 Aug 2012
Posts: 2

PostPosted: Tue Aug 07, 2012 15:58    Post subject: not working Reply with quote
Hi Guys,

First, thanks to all for all their contributions.

Second, once i get this working, i promise i will post my findings and issues in one post.

Third, so my problem is that all my files are updated properly, but my download and upload data is either 0 or really low. now im not sure if it makes any difference that im trying to monitor Interface wl0 instead of br0 or not. I will supply any details as you need them. Any help is greatly appreciated.

Thanks.
Namael
DD-WRT Novice


Joined: 10 Aug 2012
Posts: 2

PostPosted: Fri Aug 10, 2012 2:28    Post subject: Reply with quote
I am having a problem with the start up script, and I think it may be my router or setup of dd-wrt. It doesn't seem to execute any script if there are multiple lines. I know this doesn't make sense but if I place a command in the command line box that is only 1 line, it will work. But if I add more than one line, none of the commands will work. Does anyone know what this issue could be? Example, if I do this:

Code:
wget http://lal-projects.googlecode.com/svn/tags/major/1.0_wrt-bandwidth-statistics/bw_monitor.sh -O /tmp/bw_monitor.sh && chmod +x /tmp/bw_monitor.sh


It will work fine, but if I do this:

Code:
wget http://lal-projects.googlecode.com/svn/tags/major/1.0_wrt-bandwidth-statistics/bw_monitor.sh -O /tmp/bw_monitor.sh && chmod +x /tmp/bw_monitor.sh
wget http://lal-projects.googlecode.com/svn/tags/major/1.0_wrt-bandwidth-statistics/monitor.html -O /tmp/monitor.html


It will not work, but doing the commands separately one at a time does work.

Does anyone know what the issue could be? Or a workaround?
geva420
DD-WRT User


Joined: 30 Oct 2010
Posts: 108
Location: Lyon, France

PostPosted: Fri Aug 10, 2012 10:31    Post subject: Reply with quote
http://www.dd-wrt.com/wiki/index.php/Startup_Scripts#NVRAM_Method.

Quote:
Type the commands you wish to run every startup into the Commands: dialog box (place each command on a newline using the enter key, and if the command isn't something that stops running after a moment, put a '&' after the command)


The ampersand forks the process into the background... otherwise it is waiting to execute one thing at a time.

If your second option is not working, then there is probably something wrong with the wget... or it is not able to download the file... or your simply not giving it long enough.
Namael
DD-WRT Novice


Joined: 10 Aug 2012
Posts: 2

PostPosted: Fri Aug 10, 2012 14:37    Post subject: Reply with quote
Thanks for the reply.

If I telnet into the router and use the wget commands exactly as is, they work. Also, if I run the commands separately through the GUI in the router, they also work. It's when I combine more than one command that it does not work. I have tried placing the commands in Notepad++ and converting EOL to unix and making sure the encoding is ASCII and then copy and paste into the run dialog in the router's GUI but this also does not work.

I am trying to place the startup script for this bandwidth monitoring script but it doesn't work. When I investigated why it wasn't working, I noticed that the wget commands to download the files never worked, as the /tmp/ folder did not have these files. When I tried with only one line, with 1 wget command, it downloads fine but anytime I add more than one line, none of the commands will execute.

Should I try and put & after every line for the wget commands?

Also, if I use the NV RAM method, would I need to put the "&" as well, or does this limitation not exist for this method?
Vaelek
DD-WRT Novice


Joined: 07 Jul 2012
Posts: 4

PostPosted: Sat Aug 18, 2012 15:35    Post subject: Reply with quote
Namael wrote:
I am having a problem with the start up script, and I think it may be my router or setup of dd-wrt. It doesn't seem to execute any script if there are multiple lines. I know this doesn't make sense but if I place a command in the command line box that is only 1 line, it will work. But if I add more than one line, none of the commands will work. Does anyone know what this issue could be? Example, if I do this:

Code:
wget http://lal-projects.googlecode.com/svn/tags/major/1.0_wrt-bandwidth-statistics/bw_monitor.sh -O /tmp/bw_monitor.sh && chmod +x /tmp/bw_monitor.sh


It will work fine, but if I do this:

Code:
wget http://lal-projects.googlecode.com/svn/tags/major/1.0_wrt-bandwidth-statistics/bw_monitor.sh -O /tmp/bw_monitor.sh && chmod +x /tmp/bw_monitor.sh
wget http://lal-projects.googlecode.com/svn/tags/major/1.0_wrt-bandwidth-statistics/monitor.html -O /tmp/monitor.html


It will not work, but doing the commands separately one at a time does work.

Does anyone know what the issue could be? Or a workaround?


Put a ; at the end of each command
Code:
wget http://lal-projects.googlecode.com/svn/tags/major/1.0_wrt-bandwidth-statistics/bw_monitor.sh -O /tmp/bw_monitor.sh ;
chmod +x /tmp/bw_monitor.sh ;
wget http://lal-projects.googlecode.com/svn/tags/major/1.0_wrt-bandwidth-statistics/monitor.html -O /tmp/monitor.html ;


I just tested this from the Diagnostic page
Code:
touch /tmp/smbshare/test1
touch /tmp/shbshare/test2

That produces only test2, however
Code:
touch /tmp/smbshare/test1 ;
touch /tmp/shbshare/test2 ;

produces both files.
orionshock
DD-WRT Novice


Joined: 29 Apr 2011
Posts: 45

PostPosted: Mon Sep 03, 2012 22:17    Post subject: Reply with quote
Before i try this myself::
Does anyone have a zip / completed implementation that i can unpack to /opt/www and have it work with the MyPage and store all this history / backup / data to /mnt ?

My goal is to have all of the operation files in /opt/www/bwmon and all the assorted data/settings in /mnt/bwmon . I'd like to think of this as a "generic setup" type thing where it automagic as much as posible.

If anyone has it i'd be very appreciative if you would share, otherwise i'll be trying to put this type of setup togeather soon Smile
jumran
DD-WRT User


Joined: 31 Jul 2009
Posts: 492
Location: Toronto, ON, CA

PostPosted: Mon Sep 03, 2012 22:32    Post subject: Reply with quote
orionshock wrote:
Before i try this myself::
Does anyone have a zip / completed implementation that i can unpack to /opt/www and have it work with the MyPage and store all this history / backup / data to /mnt ?

My goal is to have all of the operation files in /opt/www/bwmon and all the assorted data/settings in /mnt/bwmon . I'd like to think of this as a "generic setup" type thing where it automagic as much as posible.

If anyone has it i'd be very appreciative if you would share, otherwise i'll be trying to put this type of setup togeather soon Smile


See if this version of mypage is what you are looking for.

http://www.dd-wrt.com/phpBB2/viewtopic.php?t=79941

_________________
Asus RT-N16 [Build King Kong 18050M NEWD-2 K2.6 + Optware + My Page] Mr. Green
orionshock
DD-WRT Novice


Joined: 29 Apr 2011
Posts: 45

PostPosted: Wed Sep 05, 2012 6:21    Post subject: Reply with quote
OK..
I'm still cracking away at this..
Is there a way to start the monitor w/o any user.file and just have it auto add any connected clients and allow the dnsmasq.conf to override?
Goto page Previous  1, 2, 3 ... 30, 31, 32 ... 40, 41, 42  Next Display posts from previous:    Page 31 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