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


Joined: 11 Sep 2010
Posts: 178

PostPosted: Sun Oct 30, 2011 11:24    Post subject: Reply with quote
Dark_Shadow wrote:
@FezJay,

Is there a way to lower the font size or make the page narrower? I have it embedded in my page, but its a little wide for the theme.



I have unfortuantly fixed the widths on tables. Mainly to get that horizontal scroll bar working.

So the only way to get the page to be narrower would be to do some custom alterations to the page.

The reason why I created the page based on a javascript file is so people can make adjustments to the monitor.html page to meet there needs.

If you take out that 'daily' section then narrowing the widths and font sizes would be easier.

_________________
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: Sun Oct 30, 2011 23:21    Post subject: Reply with quote
When I got everything working it was the 29th, but the usage started on the 1st. It also has not flipped to the 2nd day yet and has been over 24 hours. is this a problem in my config?
_________________
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: Sun Oct 30, 2011 23:43    Post subject: Reply with quote
Dark_Shadow wrote:
When I got everything working it was the 29th, but the usage started on the 1st. It also has not flipped to the 2nd day yet and has been over 24 hours. is this a problem in my config?


Okay, I looked at previous posts by you and I think I found your config (on the last page)

1. Are you referring to the 'reset' period? Do you expect the data to reset? If this is the case, looking at your config, you have indicated a reset day of 4. If you want this to change on the 1st of each month, then you will need to change it to 1.

NOTE: There is an issue with the current reset method where the next day command is not supported by all routers. I have made a fix to the trunk version ONLY which is still being tested.


2. Daily DATA is not being recorded (All data is being recorded against one day only). You may have accidentally specified this in you config. There is an option to have NO daily data (this was to limit the usage file size etc). If you have this flag set, then the daily data display is not relevant

In you below config, you have indicated NO daily usage (parameter 13 should be 1)

/opt/bwm/bw_monitor.sh 30 3 30 4 /tmp/dnsmasq.conf /opt/bwm/mac_usage.backup /opt/bwm/history/ '' '' 1 0 0 0 1 0 0 /opt/bwm/bwmon.log

Change the value bolded to 1, and that should fix your problem (all this information is on the wiki)

A

_________________
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: Mon Oct 31, 2011 4:00    Post subject: Reply with quote
FezJay wrote:

In you below config, you have indicated NO daily usage (parameter 13 should be 1)

/opt/bwm/bw_monitor.sh 30 3 30 4 /tmp/dnsmasq.conf /opt/bwm/mac_usage.backup /opt/bwm/history/ '' '' 1 0 0 0 1 0 0 /opt/bwm/bwmon.log

Change the value bolded to 1, and that should fix your problem (all this information is on the wiki)

A


Code:
   /opt/bwm/bw_monitor.sh 30 3 30 1 /opt/bwm/user.db /opt/bwm/mac_usage.backup /opt/bwm/history/ '' '' 1 0 0 1 1 0 0 /opt/bwm/


is this correct?

I am using an Asus RT-N16 running 17670 kingkong with OTRW and 2x 2TB USBHDD.
is what i have and is still only doing one day data. The code you have there for me was when i just started and pretty much copied and pasted without knowing what it was. I soon changed it after reading the wiki.

I have also changed my bw_monitor.sh to reflect the trunk, not sure if i got it right.

Code:
#Checks if a reset should occur
#checkReset()
#{
#   currentSecond=`expr $(date +%S) + 10`
#   currentMinuteSeconds=`expr $(date +%M) '*' 60`
#   currentHour=`date +%H`
#   currentDay=`date +%d`
#   
#   currentHourPassedSeconds=`expr $currentSecond + $currentMinuteSeconds`
#   nextDay=`date --date='next day' +"%d"`
#   nextDay=`expr $nextDay * 1`
#   hoursToMidnight=`expr $currentHour - 23`   
#   if [ $nextDay -eq $_resetDay ] && [ $hoursToMidnight -eq 0 ]; then   
#      remainingSecondsToReset=`expr $(expr $currentHourPassedSeconds + $_intervalUpdate) - 3600`
#      if [ $remainingSecondsToReset -ge 0 ]; then      
#         sleepInterval=`expr $remainingSecondsToReset - 20`         
#         if [ $sleepInterval -ge 0 ]; then   
#            sleep $sleepInterval      
#            updateUsage
#            publishUsage
#         fi      
#         sleepInterval=`expr 62 - $(date +%e)`
#         currentDay=`date +%d`
#         if [ $currentDay -ne $_resetDay ] && [ $sleepInterval -ge 0 ]; then   
#            sleep $sleepInterval
#         fi         
#         resetUsage   
#      fi
#   fi
#}
checkReset()
{
   #(24 Hours * 60 * 60)-1 = 86400
   #(Hour * 60 * 60) + (Minute * 60) + Seconds
   secondsUntilNextDay=`expr $(expr $(date +%H) '*' 60 '*' 60) + $(expr $(date +%M) '*' 60) + $(expr $(date +%S))`
   secondsUntilNextDay=`expr 86400 - $secondsUntilNextDay`
   #Determine next day number and force to numeric
   nextDay=`expr $(date --date='next day' +"%d") '*' 1`
   if [ $? -ne 0 ]; then
      #Attempt another way to determine the next day
      nextDay=`expr $(TZ=MST-24 date +%d) '*' 1`
   fi
   #Determine if next day will be reached before or after update (allow 20 second buffer)
   secondsWithUpdateUntilNextDay=`expr $(expr $secondsUntilNextDay - $_intervalUpdate) - 20`
   #force reset day to numeric
   resetDay=`expr $_resetDay '*' 1`

   if [ $nextDay -eq $resetDay ] && [ $secondsWithUpdateUntilNextDay -le 0 ]; then
      #wait until next day
      currentDay=`expr $(date +%d) '*' 1`
      while [ $currentDay -ne $_resetDay ]; do
         sleep 1
         currentDay=`expr $(date +%d) '*' 1`
      done
      sleep 5
      resetUsage
   fi
}


I also inputed in CLI

Code:
# echo secondsUntilNextDay=`expr 86400 - $secondsUntilNextDay`


With a result of

Code:
syntax error
secondsUntilNextDay=

_________________
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: Mon Oct 31, 2011 5:06    Post subject: Reply with quote
Dark_Shadow wrote:


I also inputed in CLI

Code:
# echo secondsUntilNextDay=`expr 86400 - $secondsUntilNextDay`


With a result of

Code:
syntax error
secondsUntilNextDay=


That trunk version is correct (which you have)

As for the second thing, well you can't run that code from the command line.

You cant run "echo secondsUntilNextDay=`expr 86400 - $secondsUntilNextDay`" directly from the command line.

Run this in sequence:

secondsUntilNextDay=`expr $(expr $(date +%H) '*' 60 '*' 60) + $(expr $(date +%M) '*' 60) + $(expr $(date +%S))`

secondsUntilNextDay=`expr 86400 - $secondsUntilNextDay`

echo $secondsUntilNextDay

_________________
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: Mon Oct 31, 2011 8:52    Post subject: Reply with quote
FezJay wrote:

Run this in sequence:

secondsUntilNextDay=`expr $(expr $(date +%H) '*' 60 '*' 60) + $(expr $(date +%M) '*' 60) + $(expr $(date +%S))`

secondsUntilNextDay=`expr 86400 - $secondsUntilNextDay`

echo $secondsUntilNextDay


I get

68957

_________________
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: Tue Nov 01, 2011 2:26    Post subject: Reply with quote
Now my counter has stopped. All bandwidth stats stuck, and no advance to next day.
_________________
Peacock Thread-FAQ -- dd-wrt Wiki

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


Joined: 18 Jun 2008
Posts: 166

PostPosted: Thu Nov 03, 2011 0:58    Post subject: How is this installed? Reply with quote
Hello, is this the best software for monitoring user bandwidth consumed per month? Is there documentation on how to install it? There are now 27 pages of posts about the software which is intimidating to try to track down how to begin with it. I found the code on google but I am not certain how to implement it.

So far I have managed to get USB support added to my router, a 32Gb small disk formatted per the Optware package install document and have successfully installed Optware and it is working. I wrongly assumed that the Zabbix option of Optware meant that it would run on the dd-wrt box but I see it is only an agent of Zabbix that is provided.

I currently don't have any Linux servers running nor any hardware that is robust enough to run VMWare so a Zabbix server would not be easy to poof up. That's my situation, a little knowledge with a badge to be dangerous Smile
Dark_Shadow
DD-WRT Guru


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

PostPosted: Thu Nov 03, 2011 1:17    Post subject: Reply with quote
Dark_Shadow wrote:
Now my counter has stopped. All bandwidth stats stuck, and no advance to next day.


I deleted all the files and started over. All works with v1.1

_________________
Peacock Thread-FAQ -- dd-wrt Wiki

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


Joined: 17 Feb 2008
Posts: 46
Location: Anchorage, AK

PostPosted: Thu Nov 03, 2011 7:34    Post subject: Re: How is this installed? Reply with quote
donphillipe wrote:
Hello, is this the best software for monitoring user bandwidth consumed per month? Is there documentation on how to install it? There are now 27 pages of posts about the software which is intimidating to try to track down how to begin with it. I found the code on google but I am not certain how to implement it.


I also wish someone would create a comprehensive guide including how to integrate bwmon with mypage. I've been wanting to use this great tool for a long time now.

_________________
E3000
Firmware: DD-WRT v24-sp2 (02/17/11) big - build 16214
Optware installed
USB powered hub
2TB WD external HDD
4GB Flash Drive
1GB OPT, 2.5GB swap, 2TB data

WRT54G Ver. 2
Firmware: DD-WRT v24-sp2 (11/02/09) std

WRT54G Ver. 6
Firmware: DD-WRT v24-sp2 (10/10/09) micro

ISP GCI 22m Down 2m Up 200Gb Monthly Usage Cap Crying or Very sad
FezJay
DD-WRT User


Joined: 11 Sep 2010
Posts: 178

PostPosted: Thu Nov 03, 2011 12:19    Post subject: Reply with quote
I have tested a new version 1.2 which covers the next day issue.

I have created a new major version 1.2, and all changes have been checked in (trunk as well)

_________________
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: Thu Nov 03, 2011 12:23    Post subject: Reply with quote
Dark_Shadow wrote:
Dark_Shadow wrote:
Now my counter has stopped. All bandwidth stats stuck, and no advance to next day.


I deleted all the files and started over. All works with v1.1


Depending on how you closed it down, there may have been cleanup files still in your tmp folder.

Files called monitor-stop or monitor-stopped will prevent the script from running. Just a matter of checking the tmp folder to make sure they are not there.

Try version 1.2 (actually get the file, dont try and copy and paste segments of code into an existing file).

_________________
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: Thu Nov 03, 2011 13:03    Post subject: Reply with quote
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.

_________________
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: Fri Nov 04, 2011 3:54    Post subject: Reply with quote
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?

_________________
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: Fri Nov 04, 2011 23:54    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?


Ok I went ahead and inputed 0 for cap and 1 for reset to give it a go. The page displays really big. So I redownloaded everything to make sure i didn't mess anything up and it's the same.

I am only gonna put the url to the image as it is extremely large

http://darkshadow.darkhaven.org/ScreenShot003.png

Help Smile

_________________
Peacock Thread-FAQ -- dd-wrt Wiki

Testing Multiple Routers -- Bootloader Collection Project -- My Wiki
Goto page Previous  1, 2, 3 ... 26, 27, 28 ... 40, 41, 42  Next Display posts from previous:    Page 27 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