zakkotron has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,

I want to know which module or script can tell my internet usage

Any help is greatly appreciated

Replies are listed 'Best First'.
Re: Internet usage
by luis.roca (Deacon) on Jul 03, 2011 at 18:55 UTC
Re: Internet usage
by JavaFan (Canon) on Jul 03, 2011 at 21:02 UTC
    my internet usage
    Uhm, what do you mean by "internet usage"? First, what do you measure? Amount of data? Connection time? Number of packages? Number of requests? Money spend? (Peak) bandwidth? Inbound? Outbound? Second, what do you consider internet usage? Any traffic over any interface? Anything but traffic to/from 127.0.0.1? Anything but traffic to/from 127.*.*.*? Any traffic that leaves/originates from outside your network segment? Anything that comes from/goes to your companies/home network?

      In my case,internet usage simply means the amount of data ie uploaded and downloaded from the wireless adapter that I am using

Re: Internet usage
by chrestomanci (Priest) on Jul 03, 2011 at 21:31 UTC

    As JavaFan said you would need to clarify what you define by internet usage, and there is unlikely to be a module on CPAN that will work out of the box.

    For myself, I wrote a script a while back that connects to my broadband router, and reads the cumulative packets sent & received page. It reads the numbers once a minute, and puts them into either a CSV file or a database. From there I can import the numbers into a spreadsheet or whatever and analyze it for cumulative usage, usage at various times of day, or anything else I am interested in.

    It should not be to hard to do the same, and I know of at least one windows shareware program that does that. If you would like a copy of the perl script I wrote then let me know. (It runs on Linux and talks to a Netgear router).

      Thanks for the reply,I have given reply to javafan to make myself clear.Thanks for the offer but i would first try write the code myself.

Re: Internet usage
by ambrus (Abbot) on Jul 04, 2011 at 07:38 UTC
Re: Internet usage
by jozef (Sexton) on Jul 19, 2011 at 21:07 UTC
    If you want usage for one computer interface under Linux, try to install "vnstat". For a router normally you should be able to use Net::SNMP which is a standard way of obtaining interface counter information.