Page 1 of 6 123 ... LastLast
Results 1 to 15 of 90

Thread: Graphical IP accounting

  1. #1
    Join Date
    Jun 2004
    Location
    Delft, The Netherlands
    Posts
    62

    Graphical IP accounting

    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
    Attached Files Attached Files

  2. #2
    Join Date
    Apr 2004
    Location
    Netherlands
    Posts
    1,308
    *cough* *cough*

    I'm sober now...
    Last edited by Styno; 18-10-2004 at 16:51.

  3. #3
    Join Date
    Sep 2004
    Location
    Utrecht NL
    Posts
    6

    Graphical IP accounting v2.0

    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:
    1. all usage data is stored in relative usage counters instead of absolute iptables counters

      1. router: counts for in/outbound traffic of the router itself (ftp/http) to the WAN
      2. other: counts for those LAN ip addresses that are not monitored individually (in my case 192.168.1.17-192.168.1.254)

    2. introduced 2 new "ip addresses" in the usage logging:
    3. store all data in a data folder that is set in the init.sh script
    4. changed structure of data files:

      1. per ip address:

        1. hourly usage of today in the file <ip adress>.day.dat
        2. hourly usage of a earlier day in a file like <ip adress>.20041012.dat
        3. daily total usage of this and earlier month in a file like <ip adress>.200410.dat
        4. totals for all completes months up to now in the file <ip adress>.history.dat

      2. over all ip addresses:
        1. total usage of today up till now per ip address in the file all.day.dat
        2. total usage of completed days of this month per ip address in the file all.month.dat

      3. all history data is being kept and can be shown by web page

    5. all accounting scripts combined to 1: account_traffic.sh:

      1. script runs every hour
      2. script will detect and act to day changes (at midnight)
      3. script will detect and act to month changes (at midnight, 1st day of month)
      4. script can be run with parameter "init", "daychange", "mothchange" to force a init of iptable counters, day change or moth change resp.

    6. changed web pages:

      1. combined all web pages into 1 --> traffic.cgi
      2. all presentations done by graphs (no more select boxes etc)
      3. 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
    Attached Files Attached Files
    Last edited by Mark Koops; 24-10-2004 at 20:37.

  4. #4
    Join Date
    Sep 2004
    Location
    Utrecht NL
    Posts
    6

    Updated the v2 tar files

    found some small mistakes in the tar files so i updated them in my original posting

  5. #5
    Join Date
    Apr 2004
    Location
    frankfurt
    Posts
    84
    @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

  6. #6
    Join Date
    Jun 2004
    Location
    Delft, The Netherlands
    Posts
    62
    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

  7. #7

    Graphical IP accounting is suitable for me?

    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

  8. #8

    Question installation

    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.

  9. #9

    install

    Quote Originally Posted by sodb
    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
    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.
    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

  10. #10
    What will happend after router restarting? Will I have to start scrips manualy again?
    That is what post-boot/-firewall/-mount is for.

    And how to dissable scripting? I would like to print via USB port sometimes.
    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.

    S.

  11. #11
    Quote Originally Posted by Mark Koops
    found some small mistakes in the tar files so i updated them in my original posting
    Hello Mark,

    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 23:52.

  12. #12
    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; 02-06-2005 at 00:19.

  13. #13
    Join Date
    Jun 2005
    Location
    Karlsruhe, Germany
    Posts
    44

    Question

    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:
    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 should I use as WAN address?

    What is a LANMask and which value should I use?

    Thanks for your help
    Thomas

  14. #14
    Use ifconfig (ifconfig eth1 | grep inet) to find WAN address, and LAN mask should be 255.255.255.0

    B.

  15. #15
    Join Date
    Jun 2005
    Location
    Karlsruhe, Germany
    Posts
    44
    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

Page 1 of 6 123 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •