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 ... 27, 28, 29 ... 40, 41, 42  Next
Author Message
FezJay
DD-WRT User


Joined: 11 Sep 2010
Posts: 178

PostPosted: Sat Nov 05, 2011 5:05    Post subject: Reply with quote
Mmmmm

Try version 1.1's monitor.html.

A

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

Optware (jffs/mnt) 4GB Flash Drive
Sponsor
Dark_Shadow
DD-WRT Guru


Joined: 31 Aug 2009
Posts: 2448
Location: Third Rock from the Sun

PostPosted: Sat Nov 05, 2011 5:40    Post subject: Reply with quote
FezJay wrote:
Mmmmm

Try version 1.1's monitor.html.

A
nope, same problem. Try FF and IE
_________________
Peacock Thread-FAQ -- dd-wrt Wiki

Testing Multiple Routers -- Bootloader Collection Project -- My Wiki
Dark_Shadow
DD-WRT Guru


Joined: 31 Aug 2009
Posts: 2448
Location: Third Rock from the Sun

PostPosted: Sun Nov 06, 2011 2:54    Post subject: Reply with quote
Dark_Shadow wrote:
FezJay wrote:
Mmmmm

Try version 1.1's monitor.html.

A
nope, same problem. Try FF and IE
Just re-downloaded the monitor.html from 1.1 and 1.2 they are exactly the same. Did they get posted wrong?
_________________
Peacock Thread-FAQ -- dd-wrt Wiki

Testing Multiple Routers -- Bootloader Collection Project -- My Wiki
FezJay
DD-WRT User


Joined: 11 Sep 2010
Posts: 178

PostPosted: Fri Nov 11, 2011 0:34    Post subject: Reply with quote
Is anyone else having the same issue that Dark Shadow is having?

Is the layout gone all out of whack (almost like the styles or javascript is not enabled)

Let me know. I may have modified the html file incorrectly (but I have not changed it for a long time).

Hey Dark, just out of interest have you named any of your users/machines with characters that might affect an HTML page?

I dont do any character checking on user/machine names etc.

Could be affecting the HTML layout

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

Optware (jffs/mnt) 4GB Flash Drive
Dark_Shadow
DD-WRT Guru


Joined: 31 Aug 2009
Posts: 2448
Location: Third Rock from the Sun

PostPosted: Fri Nov 11, 2011 1:40    Post subject: Reply with quote
Dark_Shadow wrote:
Dark_Shadow wrote:
FezJay wrote:
Try version 1.2 (actually get the file, dont try and copy and paste segments of code into an existing file).


Got the files downloaded, will give it a shot after work.
A little lost...


Quote:
sed -e 's/src=.*>/src="http:\/\/192.168.xxx.xxx\/user\/user_details.js"><\/script>/' -e 's/[USAGE_CAP]/50/' -e 's/[RESET_DAY]/05/' /opt/bwm/monitor.html > /www/user/monitor.html


1. [USAGE_CAP] = GB MB? And what for no cap, 0?
2. /50/ - Whats this do?
3. [RESET_DAY] = I would assume 1 for the 1st 2 for the 2nd etc..
4. /05/ - Whats this do?


Any help FezJay?

Edit: I found out [RESET_DAY] has to be a 2 digit number. ex.. 01, not 1. Anyway here is a screenshot.

I notice that "Monthly Usage - Daily Breakdown is messed up. the days show below the totals.

_________________
Peacock Thread-FAQ -- dd-wrt Wiki

Testing Multiple Routers -- Bootloader Collection Project -- My Wiki
Dark_Shadow
DD-WRT Guru


Joined: 31 Aug 2009
Posts: 2448
Location: Third Rock from the Sun

PostPosted: Sat Nov 12, 2011 1:29    Post subject: Reply with quote
does anyone know?
_________________
Peacock Thread-FAQ -- dd-wrt Wiki

Testing Multiple Routers -- Bootloader Collection Project -- My Wiki
Dark_Shadow
DD-WRT Guru


Joined: 31 Aug 2009
Posts: 2448
Location: Third Rock from the Sun

PostPosted: Mon Nov 14, 2011 3:11    Post subject: Reply with quote
I have messed around with the numbers to no avail. I have also tried to narrow the space between columns as well as get rid of the "Total" lines under each user.

I am just not advanced enough to figure out the code or which part does what.

I would still like to know what those numbers do in the command line.

Hopefully FezJay can shed some light.

_________________
Peacock Thread-FAQ -- dd-wrt Wiki

Testing Multiple Routers -- Bootloader Collection Project -- My Wiki
wooly
DD-WRT Novice


Joined: 06 May 2009
Posts: 29

PostPosted: Fri Nov 18, 2011 17:29    Post subject: Reply with quote
Hi, a definite linux / WW-DRT programming noob here.

I have been playing around with this monitor for a couple of days and have run into the same problem as Dark_Shadow with the very large display of the monitor page.

For the time being I have worked around this by getting the monitor up and running, then deleting /tmp/www/monitor.html and replacing it with the original. This works fine but does not show the usage cap or reset day. I got around that by hard coding it into the original monitor.html. Not a good approach but it works.

I too would be interested in an explanation od the sed line in the start-up script. In the mean time I'll carry on playing

wooly
wooly
DD-WRT Novice


Joined: 06 May 2009
Posts: 29

PostPosted: Sat Nov 19, 2011 15:18    Post subject: Decoded???? Reply with quote
I may have got a handle on the sed line

Firstly, this line of code is only run if there is not a copy of monitor.html in the users directory, in my case /tmp/www

Going to the end of the line:

/[DIR]/monitor.html > /[WWW DIR]/monitor.html

This is the source file and destination file, not sure whether the [DIR] and [WWW DIR] are anything magic that should work automatically so I just changed [DIR] for the location of the original monitor.html file and [WWW DIR] for the destination

In the following, sed will look for an expression in the source file and change it in the destination file.


sed -e 's/src=.*>/src="http:\/\/192.168.1.1\/user\/user_details.js"><\/script>/'

In this case sed looks for a line containing "src=" and replaces it with "src=http:.....etc." In this case just replace 192.168.1.1 with the appropriate address for your setup.

In the next case sed looks for [USAGE_CAP] within the source file and replaces it with what follows, in this case "50" so change "50" for what your cap is.


-e 's/[USAGE_CAP]/50/' -e

Finally, in the source file [RESET_DAY] is replaced with "05" or what ever you replace it with.

's/[RESET_DAY]/05/'


So far all this is theory from reading the sed info I found and hasn't been put to the test.

What still confuses me is what appears to be the inconsistent use of text in square brackets. Sometimes, I believe, it needs to be modified as in the case of [DIR] and [WWW DIR] and at other times it needs to be left as is [RESET_DAY]

Hope the above helps and is not too far off the mark
Dark_Shadow
DD-WRT Guru


Joined: 31 Aug 2009
Posts: 2448
Location: Third Rock from the Sun

PostPosted: Sat Nov 19, 2011 19:38    Post subject: Reply with quote
So your saying that if my cap was zero and the reset day is the first of the month it should look like

Code:
-e 's/[USAGE_CAP]/0/' -e 's/[RESET_DAY]/1/'

_________________
Peacock Thread-FAQ -- dd-wrt Wiki

Testing Multiple Routers -- Bootloader Collection Project -- My Wiki
wooly
DD-WRT Novice


Joined: 06 May 2009
Posts: 29

PostPosted: Sat Nov 19, 2011 20:34    Post subject: Reply with quote
That is what I expected to happen, but after changing the shocks on the truck and having a bit of spare time to play here are the results Sad


from the prompt

Code:
sed -e 's/[USAGE_CAP]/60/'  //mnt/test/test.html > /mnt/test/www/test1.html


using the following html file

Code:

    </script>
    <script type='text/javascript' src='http://192.168.1.1/user/user_details.js'></script>
    <script type='text/javascript'>
      var totalUsageDownloaded=0;
      var totalUsageUploaded=0;
       <div>
         Internet Usage Cap: [USAGE_CAP] GB
         <br/>
         Internet Usage Resets on day [RESET_DAY] of Every Month
         <br/>
         <br/>
         <script type="text/javascript">
         if(_useSuffix || _useSuffix != "")
         {
            document.write('ALL USAGE DETAILS ARE DISPLAYED IN: <b>' + getUsageDisplay(_useSuffix) + '</b></br></br>');
         }

gives


Code:
    </script>
    <script type='text/javascript' src='http://192.168.1.1/user/user60details.js'></script>
    <script type='text/javascript'>
      var total60sageDownloaded=0;
      var total60sageUploaded=0;
       <div>
         Internet 60sage Cap: [USAGE_CAP] GB
         <br/>
         Internet 60sage Resets on day [RESET_DAY] of Every Month
         <br/>
         <br/>
         <script type="text/javascript">
         if(60useSuffix || _useSuffix != "")
         {
            document.write('60LL USAGE DETAILS ARE DISPLAYED IN: <b>' + getUsageDisplay(_useSuffix) + '</b></br></br>');
         }


As you can see a number of "60"'s have replaced characters in the original. All replaced characters existed in "USAGE_CAP"

However the part to change the ip address worked as I expected.
Dark_Shadow
DD-WRT Guru


Joined: 31 Aug 2009
Posts: 2448
Location: Third Rock from the Sun

PostPosted: Sat Nov 19, 2011 21:15    Post subject: Reply with quote
Are you using with the original html or v1.2 html?
_________________
Peacock Thread-FAQ -- dd-wrt Wiki

Testing Multiple Routers -- Bootloader Collection Project -- My Wiki
wooly
DD-WRT Novice


Joined: 06 May 2009
Posts: 29

PostPosted: Sun Nov 20, 2011 0:31    Post subject: Reply with quote
1.2
djroby19
DD-WRT Novice


Joined: 23 Dec 2009
Posts: 34
Location: Italy

PostPosted: Mon Nov 21, 2011 20:26    Post subject: Help guide... Reply with quote
Hello everyone .. I wanted some advice ... I want to integrate this gorgeous monitor in my dd-wrt where I can find a step by step how to do? Thank you all for the help ... Very Happy
_________________
Buffalo WZR-HP-AG300H DD-WRT v24-sp2 (03/19/12) std - build 18777 + modem Digicom combo cx + Nas Synology DS-209 da 2 T + LG DP1W+ APC Back-UPS RS-Power Saving Back-UPS Pro 550 + switch Zyxel Gs105B + http://forum.emulesecurity.net/topic.asp?TOPIC_ID=3441
Moleshome
DD-WRT Novice


Joined: 14 Oct 2011
Posts: 9

PostPosted: Tue Nov 22, 2011 17:38    Post subject: Reply with quote
wooly wrote:
As you can see a number of "60"'s have replaced characters in the original. All replaced characters existed in "USAGE_CAP"

However the part to change the ip address worked as I expected.


What if you use:

Code:
sed -e 's/\[USAGE_CAP\]/60/'  //mnt/test/test.html > /mnt/test/www/test1.html
Goto page Previous  1, 2, 3 ... 27, 28, 29 ... 40, 41, 42  Next Display posts from previous:    Page 28 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