1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Local Traffic Accounting

Discussion in 'DD-WRT Firmware' started by chkauer, Mar 22, 2006.

  1. chkauer

    chkauer Network Guru Member

    Hello !

    I´m using DD-WRT for a while now and like it very much.

    What I´m missing, is a simple traffic accounting, very useful if your provider has a monthly UL/DL-Limit.

    I couldn´t find anything about this in the forum, so I´ll try to do it like this :

    per cron, every half an hour i want to grep the TX/RX bytes from the ifconfig command, accumulate it with the result from the last one saved on jffs or mmc (the script shouldn´t be the problem).
    In this way i want to make stats for let´s say the last two month and a per day stat for the actual month. this stats will be presented on a html site (also no problem).

    BUT : i also have to take care in case the router reboots, then the scripts also has to be executed, and that´s where my problem occures :
    I couldn´t find where to place a script that should be executed right before shutting down or reboot.

    Does anyone have an idea how to solve this (is there a rc_shutdown or something like this ?)

    And, did anyone have this idea before and implemented already ? (Don´t want to reinvent the wheel :) )

    regards,
    Chris
     
  2. GoldServe

    GoldServe Network Guru Member

    bwlog. Goggle that. cheers.
     
  3. chkauer

    chkauer Network Guru Member

    Thanks for reply !

    I found bwlog already, but that´s not what i think about, because it looses data when router is rebooted.. and the backup option is not very useful for writing on flash.. will kill the flash too quickly.

    the main question still is : is there a possibility to run a script just before shutting down ?

    greetz,
    Chris
     
  4. callous

    callous Network Guru Member

    Hypwrt has this built in.. If you arent even using 5% of the capabilities of DDRWT, then use hypwrt instead.
     
  5. xcaliba

    xcaliba Network Guru Member

    You can set bwlog to backup to a ftp server so you do not loose your data. You can then set up a script to reinstall it each time your router reboots and get your up to date usage. The instructions are on the bwlog website.
     
  6. trey504

    trey504 Network Guru Member

    Run it from a smbshare works great just when you load on startup use a long sleep or a loop to reload it every 20mins if it looses connection
     
  7. chkauer

    chkauer Network Guru Member

    Please read my first post, i do not have a smbshare that is permanently connected.. :)

    greetz,
    Chris
     

Share This Page