Page 1 of 2 12 LastLast
Results 1 to 15 of 90

Thread: Graphical IP accounting

Hybrid View

Previous Post Previous Post   Next Post Next Post
  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 15: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 19: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

    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

  8. #8
    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 22:52.

  9. #9
    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.

  10. #10
    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

  11. #11

    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

  12. #12

    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.

  13. #13

    RRDTool on USB flash memory

    I have one qustion about RRD Tool, CRON scheduled task and 128MB USB flash disk in WL-500g. Every flash disk have finite write cycles and after installing RRDTool and CRON on 1st partition with 2nd partition used as swap, then LED diode blinks quite often (I think 1 minute and then 4 minutes not). My question is if statistic for RRDTool is big file or not, if USB flash disk will be destructed after 6 months or not - I don't know why this flash disk blinks so much.
    Thx for your answers.

  14. #14

    rrdtoolcorrupted immage

    Thank You sobd for the manual. I wollw Your instructionas and almost got everything working...except the *.gif files looks little strange...I checket the scripts for generating charts - they're running without errors. Any idea whats wrong with my installation? The trafic data seems to be logged correctly:

    root@OpenWrt:/opt/usr/bin/iprrd# ./update_traf.sh
    updating usage counters
    IP Bytes In Bytes Out
    192.168.150.2: 0, 0 ---;
    eth0: 1380861, 1330602 ---;
    router: 44708, 30401 ---;
    other: 0, 0 ---;

    Thanks
    Attached Images Attached Images   

  15. #15
    Join Date
    Sep 2005
    Location
    Slovakia
    Posts
    73
    Kamilek sent me this skript http://www.home.karne...0603501/zdenek
    and i translete it. when anybody have interest i uploade it to this forum

Page 1 of 2 12 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
  •