*cough* *cough*
I'm sober now...
For those who are interesed I created some scripts to do graphical IP accounting on the ASUS. A description and some installation details are on the WikiPage:
GraphicalIpAccounting
Tarballs are attached!
Hope you like it
*cough* *cough*
I'm sober now...
Last edited by Styno; 18-10-2004 at 15:51.
Good Work, sodb!
Your scripts inspired me to start exploring the world of bash scripts/awk/iptables/etc. And the working model was of great help to start understanding how to deal with these progs.
I found it a nice exercise to adapt the scripts to extend their functionality.
v2 of tarballs are attached.
changes:
- all usage data is stored in relative usage counters instead of absolute iptables counters
- router: counts for in/outbound traffic of the router itself (ftp/http) to the WAN
- other: counts for those LAN ip addresses that are not monitored individually (in my case 192.168.1.17-192.168.1.254)
- introduced 2 new "ip addresses" in the usage logging:
- store all data in a data folder that is set in the init.sh script
- changed structure of data files:
- per ip address:
- hourly usage of today in the file <ip adress>.day.dat
- hourly usage of a earlier day in a file like <ip adress>.20041012.dat
- daily total usage of this and earlier month in a file like <ip adress>.200410.dat
- totals for all completes months up to now in the file <ip adress>.history.dat
- over all ip addresses:
- total usage of today up till now per ip address in the file all.day.dat
- total usage of completed days of this month per ip address in the file all.month.dat
- all history data is being kept and can be shown by web page
- all accounting scripts combined to 1: account_traffic.sh:
- script runs every hour
- script will detect and act to day changes (at midnight)
- script will detect and act to month changes (at midnight, 1st day of month)
- script can be run with parameter "init", "daychange", "mothchange" to force a init of iptable counters, day change or moth change resp.
- changed web pages:
- combined all web pages into 1 --> traffic.cgi
- all presentations done by graphs (no more select boxes etc)
- the bars in the graphs can be clicked to zoom in on details
my scripts depend on awk being found by the system, which you can arrange by the command:
ln -s <your path to busybox full version> /bin/awk
Hope you like it and I am waiting for some comments of you.
Mark
Last edited by Mark Koops; 24-10-2004 at 19:37.
found some small mistakes in the tar files so i updated them in my original posting
@mark.
can i also use the howto from sodb for install?
is there something different if i want to use graphical ip accounting with fw 1.8.xx?
thx in advance...
Athlon XP 2200+ runnig on ECS K7S5A
512 MB DDR
160 GB Samsung
Ati Radeon 9500
System running under Yoper.v2
Router: WL500g
xelephant,
you certainly can use it with new firmware. Change the mount point in the init.sh script. The wiki page is not describing the scripts that Mark wrote. I installed Mark's scripts with some small changes (e.g. the root crond file is lacking in the tar ball). Using the post of Mark I will update the wiki page so that it describes the latest version,
regards
Hi
I've a Asus WL-500g at home to distribute internet access for 4 computers, 3 Windows PC and 1 Macintosh. We are all students living in the same house.
So here's what I'm searching: I would like to have, at the end of the month, a graphic showing the percentage of every computer's downloads so that each one could pay the ammount according to the internet's use. I'm really new to all this and none of us here at home are familiar with coding.
Is "Graphical IP accounting" is suitable to do what I want? If so, there is any way to run a script automatically without having to type everything by hand?
Thank you in advance and forgive my ignorance
Best Regards
Nuno
I canīt find the installation manual for Mark's ipaccounting. I think that quide which is described on http://wiki.wl500g.info/index.php/GraphicalIpAccounting is still showing installation process for old scripts, isnīt it? Where could I find new installation quide? Iīm beginner in Linux.
- after router restarting is it working again or I will have to run it manualy?
Thanks a lot.
Kamil.
I canīt find installation guide for Mark's scripts. Do anybody have it? I think that the guide on wiki pages is still for older ipaccounting scripts.Originally Posted by sodb
What will happend after router restarting? Will I have to start scrips manualy again? And how to dissable scripting? I would like to print via USB port sometimes.
K
That is what post-boot/-firewall/-mount is for.What will happend after router restarting? Will I have to start scrips manualy again?
Once you unplug your usb stick, anything on /tmp/harddisk/ is unaccesible and scripts will fail, but no harm is done. If you like you can just stop the crond (killall crond) and then restart it when you plug your stick back in. But the easiest of course is to buy an usb-hub. Then you can have everything pluged in all the time! Not very expensive either.And how to dissable scripting? I would like to print via USB port sometimes.
S.
Hello Mark,Originally Posted by Mark Koops
I need you help regarding to Graphical IP Accounting V2. I would like to use your vesrion. For installing I used the HOWTO from SODB, but in your tarball I couldnot find the root for crond. I used from V1.
In our wifi site we used Ips with step 10, as 10, 20, 30, 40, 50. In a case of INIT.SH setting I have to use LOWERIP=10 UPPERIP=50, but it takes very long time for ASUS to calculate and to prepare a dat files .. around 70minutes! And the generated HTML pages is very big ... a lot of unused IPs beetween 10-20-30-40-50. There is some possibilities or setting how to meka it little bit faster and how I can select just a used IP-s to HTML generating and accounting?
Thank you
Wizi
Last edited by WiziPok; 29-05-2005 at 22:52.
Hello,
Mea Culpa .... my fault .... WORKING FINE !!!!!
.............. just found some features, which doesnot works
... to get the traffic to the web I had to use eth0
... but still the field OTHERS and ROUTER doesnot calculate the traffic - but the router_in and router_out chains contains data !
... on the web are still missing the HISTORYCAL data, but in history folder the data are ....
can somebody help me?
Thanks a lot, WiZiPoK
Last edited by WiziPok; 01-06-2005 at 23:19.
Hi together,
I am using Marks script, but traffic is not counted. I think the cause are wrong values in the init.sh. Could someone tell me please what to type in? Here is some inormation about my config.
- My router has LAN adress 192.168.1.1
I do not have a fixed WAN adress
I have clients in the range from 192.168.1.50 to 192.168.1.61
Here is init.sh:
What should I use as WAN address?Code:#directory where accounting scripts reside accountdir=/tmp/harddisk/accounting datadir=/tmp/harddisk/accounting/data # pointer to AWK applet AWK="/bin/busybox awk" LAN="192.168.1.1" WAN="???.???.???.???" #ipprefix consists of the first 3 number of your #LAN side ip addres. Together with a 4th number in the #range lowerip to upperip, it makes the range of ip addresses #to be monitored in your LAN. # #warning: upperip relates to LANMask as: #ipprefix.upperip is the highest address that fits in ipprefix.0/LANMask ipprefix="192.168.1" let lowerip=50 let upperip=61 LANMask=???
What is a LANMask and which value should I use?
Thanks for your help
Thomas
Use ifconfig (ifconfig eth1 | grep inet) to find WAN address, and LAN mask should be 255.255.255.0
B.
I know my actuall Ipadress but is changes every day. So I think i were not very useful to change it every day manually.
255.255.255.0 is the subnet mask. But LANMask seems to be something different. And the example show a value of 28. But what should that be?
Examplescript:
Code:#directory where accounting scripts reside accountdir=/mnt/usbfs/accounting datadir=/accountingdata # pointer to AWK applet AWK="awk" LAN="<LAN side ip address of your router>" WAN="<WAN side ip address of your router>" #ipprefix consists of the first 3 number of your #LAN side ip addres. Together with a 4th number in the #range lowerip to upperip, it makes the range of ip addresses #to be monitored in your LAN. # #warning: upperip relates to LANMask as: #ipprefix.upperip is the highest address that fits in ipprefix.0/LANMask ipprefix="192.168.1" let lowerip=2 let upperip=16 LANMask=28