LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Byte-counting software (https://www.linuxquestions.org/questions/linux-networking-3/byte-counting-software-856464/)

Completely Clueless 01-15-2011 06:40 AM

Byte-counting software
 
Hi all,

At present I have to live with a 5Gb/month data volume limitation. Due to having to monitor this usage, I have been forced to use the software that came with the web dongle - and that means having to use Windows (spit!)

Can anyone recommend a Linux package I could download that readily shows how much data one has uploaded/downloaded over a set period?

TIA,

cc

allend 01-15-2011 07:48 AM

Every ISP I have ever used has allowed me to log in and manipulate my account settings, including checking usage, using a web interface. This is preferable as ISPs often offer free access to certain services, so the usage you counted locally would be overestimated.
In the end it is the ISP's count of your usage that matters, not yours.

Nominal Animal 01-15-2011 11:27 AM

The kernel does keep track of the number of bytes sent (TX) and received (RX) for each and every network interface, and they are trivially accessible via the ifconfig command. You could easily set up a script in cron which regularly saves the current counts; the amount of data transferred in an interval is then just the difference between the counts at the ends of the interval. The counts do reset to zero whenever the interface is brought down, so you'd also need to modify the ifdown scripts to mark the last count and note the reset in the transfer logs.

While this is really this simple, I haven't seen any packages geared towards monitoring accumulated transfer counts; everything seems to be more geared towards bandwidth monitoring.

However, allend is absolutely right: It's the ISP's count of your usage that matters, not yours. Not all of your traffic is counted against your limits.

Your ISP should have set up a page where your transfer statistics are visible. If you don't want to keep a tab open to that page, or to load it every now and then, you could cobble together a wget script to download that page and then pick out the numbers via an awk, bash, perl, php, python or sed script.

If you need help with the scripting, open up a new question in the programming section.

Cheers,
Nominal Animal

Completely Clueless 01-15-2011 12:09 PM

Thanks, guys.

I'm afraid my ISP currently (I move around a lot internationally) is o2 Germany. They do have a customer sign-in portal for settings and whatnot, but it's a very large and multi-layered site; there's no English language option and so consequently one faces a baffling array of unfamtilar terms in Foreign. Words like "Einzelverbindungsnachweis" for example. The Germans don't seem much inclined to using the space bar, it seems. Probably something to do with their legendary efficiency I would imagine. :)


All times are GMT -5. The time now is 02:33 PM.