Find the answer to your Linux question:
Results 1 to 3 of 3
I am looking for a way to track my internet megabit volume up and down. I've already tried through my ISP provider and they don't log anything. I'm thinking of ...
  1. #1
    Just Joined!
    Join Date
    Jul 2010
    Posts
    30

    Advise needed for tracking my internet volume

    I am looking for a way to track my internet megabit volume up and down.

    I've already tried through my ISP provider and they don't log anything.

    I'm thinking of switching my ISP to verizon but they limit you to 50 megabytes per month. Crappy of them to do that Years ago they had an unlimited access plan but dropped it.

    So what I need is a way to log my own internet usage

    I'm using a linksys BEFSX41 Router right now and have the log provision turned on and their logfile viewer software installed on my W2K machine. But it doesn't log the bytes used.

    Any Ideas???

    Thanks

    Ron

  2. #2
    Linux Newbie theNbomr's Avatar
    Join Date
    May 2007
    Location
    BC Canada
    Posts
    150
    If all traffic funnels through a Linux host at some point, then the logging capability of iptables can be used. In fact I have been doing so for the very reason that you cite for several years.
    Essentially, I take advantage of iptables byte and packet logging. A cron job that runs every minute:
    Code:
    0-59 * * * * /sbin/iptables -vnxZ -L | perl -e '@in=<>; foreach $rule ( @in ){ if( $rule =~ m/ACCEPT/ ){ @rule=split /\s+/, $rule; $bytes += $rule[2];}}$t=scalar localtime(time); $t =~ m/[A-z][a-z][a-z] (.+)/; print "$1 ", time, " $bytes\n";' >> /var/log/iptablesStats.log
    You would have to have at least enough rules in your host that all traffic would be logged. I haven't added anything special to do logging, merely using the firewall rules.
    The log file is parsed, plotted, and summary data printed by a web application on demand. logrotate rotates the log file weekly. The logs do not distinguish between data sent vs. received.

    --- rod.
    Stuff happens. Then stays happened.

  3. #3
    Just Joined!
    Join Date
    Jul 2010
    Posts
    30
    Thanks, I found out my linux boxes woudl track the usage but using too much to bother with verizon. Man these limited usage contracts are pretty much pointless.

Posting Permissions

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