Though how hard would it be to show every number in GB (I'm searching for abuser so I don't really care about bytes) and right aligned to be easier to read (I have zero html experience though I'm fairly good with VBA and C#)?
Also would it be feasible to start the "Monthly Usage - Daily Breakdown" section with the reset day instead of the 1st day
Oh that's how to use this argument , I tryed to GB instead of 3 then I tryed 1 and it worked so I thought it was boolean. By the way instead of writing 0GB I replaced it by a "-" and it's much cleaner and easier to get to the important number
LOL, yeah Graphs...I would love to, but ideally I'd like to use Jquery for it. Makes things so much easier man.
Got to keep in mind though, people have different routers with different specs, gt to try and keep things simple. _________________ dd-wrt eko/V24-K26 15508
Belkin F7D4301
8MB Flash
64MB RAM
I loved the opening post and then waded through a few pages of technical posts and my eyes glazed over...
The reports posted at the beginning seem to do exactly what I what I want - to segregate usage by user and produce simple information.
We are trying to find out where the excess usage is coming from as the usage counters on each computer don't add up to the total on the ISP website - sometimes with hundreds of MB difference... Last month, we are slowed to a crawl for 5 days and I work from home - ugh. There are a few other items around the house like jailbroken ipods/smart phones etc. that may be doing some auto updating (and for which I can't find bandwidth utilities) or it may be something stealthy running on someone's computer (I have removeed that %#$#^@%$# PC Tools app from computers a couple of times recently. Grrrr....)
A few questions:
1. Is the link to google code at the beginning of these posts the current version?
2. It appears that you're running a program on the router with some nice reporting and segregating usage by mac address with some rolling up/summarizing of numbers. Do I understand that correctly?
3. Are you currently making updates to a "released" software or are you still in alpha/beta test right now?
I'm technical enough to have installed dd-wrt, but since the last time I opened up a unix command line was 1985 (LOL - with the exception of the dd-wrt install, it's true!)
I am looking for something that's relatively simple. I don't have a spare computer to run a remote reporting setup as described elsewhere on the BB.
My setup:
---------
Linksys WRT-54G
DD-WRT v24-sp2 (10/10/09) micro
Your input would be greatly appreciated and thanks in advance!
I think you are in luck, a user with your router has got it going on his router and fortuantly has left his script , which I have included below
Its all on page 14-17 as well. Hope it helps
UPDATE (Muz)
have gotten both wrtbwmon AND bw_monitor to work.
have also managed to install optware in the process.
here's the startup script:
#!/bin/sh
sleep 5
if [ -f /mnt/optware.enable ]; then
mount -o bind /mnt/etc /etc
mount -o bind /mnt/root /tmp/root
mount -o bind /mnt/opt /opt
else
exit
fi
if [ -d /opt/usr ]; then
export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/lib:/usr/lib'
export PATH='/opt/bin:/opt/usr/bin:/opt/sbin:/opt/usr/sbin:/bin:/sbin:/usr/sbin:/usr/bin'
else
exit
fi
while [ ! -f /tmp/monitor-started.lock ] && [ ! -f /tmp/monitor-stop ]; do
cp /mnt/monitor.html /tmp/www/monitor.html
/mnt/bw_monitor.sh 30 3 30 1 /mnt/users.txt /mnt/mac_usage.backup /mnt/history/ /mnt/mac_usage.db '' 1 0 1 1 1
if [ ! -f /tmp/monitor-started.lock ]; then
sleep 10
fi
done &
I am a bit confused about this. I want everything to run off my external usb drive on /opt
1. I have an external usb drive mounted on /opt
2. I have downloaded the 4 scripts (bw_monitor.sh, bw_monitor.shutdown, bw_monitor.startup, monitor.html) do I put all 4 in /opt/etc/init.d?
3. do I copy your script below and name bw_monitor.startup and use the bw_monitor.shutdown as the shutdown script?
4. I also have a oidentd script in my startup so can I append that? bloew is my script currently
#!/bin/sh
start oidentd
/opt/etc/init.d/oidentd start
#
5. How do I load the startup and shutdown scripts?
munzab wrote:
UPDATE
have gotten both wrtbwmon AND bw_monitor to work.
have also managed to install optware in the process.
here's the startup script:
#!/bin/sh
sleep 5
if [ -f /mnt/optware.enable ]; then
mount -o bind /mnt/etc /etc
mount -o bind /mnt/root /tmp/root
mount -o bind /mnt/opt /opt
else
exit
fi
if [ -d /opt/usr ]; then
export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/lib:/usr/lib'
export PATH='/opt/bin:/opt/usr/bin:/opt/sbin:/opt/usr/sbin:/bin:/sbin:/usr/sbin:/usr/bin'
else
exit
fi
while [ ! -f /tmp/monitor-started.lock ] && [ ! -f /tmp/monitor-stop ]; do
cp /mnt/monitor.html /tmp/www/monitor.html
/mnt/bw_monitor.sh 30 3 30 1 /mnt/users.txt /mnt/mac_usage.backup /mnt/history/ /mnt/mac_usage.db '' 1 0 1 1 1
if [ ! -f /tmp/monitor-started.lock ]; then
sleep 10
fi
done &
ok.. Got OptWare installed and working.
I'd like all files being thought of created in /mnt/monitor
I don't have any IP's statically assinged via DNSMasq.
For clarity what i'd like settings :
Update Every 30 sec
Publish every 4 Updates
Backup every 30
Reset Every day
UserFile : /mnt/monitor/user.file
BackupUseage : /mnt/monitor/useage.backup ( Should this be a dir or file?)
BackupHist : /mnt/monitor/hist (dir)
MacUseageFile : /mnt/monitor/mac_useage.db
JSOutput : /mnt/monitor/
Do Usage File Restore : yes
Keep Last Javascript File : Yes
History Javascript File : Yes ( do i need it, what exactly does it benefit me for? )
Record Daily Usage : Yes
Auto Add MAC Addresses : Yes
Add 32 BIT support : ??
Show MAC Addresses : No
LOG : no..
Code:
#!/bin/sh
MONITOR_LOCK_FILE=/tmp/monitor-started.lock
MONITOR_STOP_FILE=/tmp/monitor-stop
MONITOR_STOPPED_FILE=/tmp/monitor-stopped
while [ ! -f $MONITOR_LOCK_FILE ] && [ ! -f $MONITOR_STOP_FILE ]; do
if [ ! -f /mnt/monitor/monitor.html ]; then
sed 's/src=.*>/src="http:\/\/192.168.1.1:81\/user\/user_details.js"><\/script>/' /mnt/monitor/monitor.html > /mnt/monitor/monitor.html
fi
echo "RunScipt"
/mnt/monitor/bw_monitor.sh 30 4 30 4 /mnt/monitor/user.file /mnt/monitor/useage.backup /mnt/monitor/hist/ /mnt/monitor/mac_useage.db /mnt/monitor/ 1 1 0 1 1 0 0 NO
if [ ! -f $MONITOR_LOCK_FILE ]; then
sleep 10
fi
done
It's not making a .js file and nothing is showing when viewing the monitor.html file.
-------
If i turn logging on it says that there are no users in the dnsmasq2users file and then exits.
-------
Can i symlink bw_monitor.startup to /opt/etc/init.d/S99bwmon ?
Can i symlink bw_monitor.shutdown to /opt/etc/init.d/K06bwmon ?
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
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.
I think you are in luck, a user with your router has got it going on his router and fortuantly has left his script , which I have included below
Its all on page 14-17 as well. Hope it helps
UPDATE (Muz)
have gotten both wrtbwmon AND bw_monitor to work.
have also managed to install optware in the process.
here's the startup script:
#!/bin/sh
sleep 5
if [ -f /mnt/optware.enable ]; then
mount -o bind /mnt/etc /etc
mount -o bind /mnt/root /tmp/root
mount -o bind /mnt/opt /opt
else
exit
fi
if [ -d /opt/usr ]; then
export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/lib:/usr/lib'
export PATH='/opt/bin:/opt/usr/bin:/opt/sbin:/opt/usr/sbin:/bin:/sbin:/usr/sbin:/usr/bin'
else
exit
fi
while [ ! -f /tmp/monitor-started.lock ] && [ ! -f /tmp/monitor-stop ]; do
cp /mnt/monitor.html /tmp/www/monitor.html
/mnt/bw_monitor.sh 30 3 30 1 /mnt/users.txt /mnt/mac_usage.backup /mnt/history/ /mnt/mac_usage.db '' 1 0 1 1 1
if [ ! -f /tmp/monitor-started.lock ]; then
sleep 10
fi
done &
sleep 10
# Backup usage database file
while :
do
sleep 900
cp /tmp/usage.db /mnt/usage.db
done
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.
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?
while [ ! -f /tmp/monitor-started.lock ] && [ ! -f /tmp/monitor-stop ]; do
cp /mnt/monitor.html /tmp/www/monitor.html
/mnt/bw_monitor.sh 30 3 30 1 /mnt/users.txt /mnt/mac_usage.backup /mnt/history/ /mnt/mac_usage.db '' 1 0 1 1 1 0 1
if [ ! -f /tmp/monitor-started.lock ]; then
sleep 10
fi
done &