Tux

...making Linux just a little more fun!

Monitoring IP usage

Bob van der Poel [bob at mellowood.ca]
Sat, 16 Dec 2006 09:48:41 -0700

A fellow asked me the other day "what is your total IP (up and down) per month)?" I figured that since I was using Linux it'd be an easy answer ... well, really I have no idea :)

I do have a little "net-applet" on my desktop which shows the total since the last login (to the desktop, not the computer). Is there a log file tracking this or a daemon I can install?

If it makes a difference I'm running Mandriva 2007.

Thanks.

-- 
Bob van der Poel ** Wynndel, British Columbia, CANADA **
EMAIL: bob@mellowood.ca
WWW:   http://www.mellowood.ca

Top    Back


Mulyadi Santosa [mulyadi.santosa at gmail.com]
Sun, 17 Dec 2006 01:34:07 +0700

Hi Bob

> A fellow asked me the other day "what is your total IP (up and down)
> per month)?" I figured that since I was using Linux it'd be an easy
> answer ... well, really I have no idea :)

Well, AFAIK, if you KPPP, it is shown in the monthly log. Please check there..

regards,

Mulyadi


Top    Back


Bob van der Poel [bob at mellowood.ca]
Sat, 16 Dec 2006 12:51:11 -0700

Mulyadi Santosa wrote:

> Hi Bob 
>> A fellow asked me the other day "what is your total IP (up and down)
>> per month)?" I figured that since I was using Linux it'd be an easy
>> answer ... well, really I have no idea :)
> 
> Well, AFAIK, if you KPPP, it is shown in the monthly log. Please check 
> there..

Thanks. But isn't kppp just for doing dialup? My ethernet is just connected to my satellite modem (same as a cable modem, but slower).

-- 
Bob van der Poel ** Wynndel, British Columbia, CANADA **
EMAIL: bob@mellowood.ca
WWW:   http://www.mellowood.ca

Top    Back


Predrag Ivanovic [predivan at ptt.yu]
Sun, 17 Dec 2006 00:42:08 +0100

On Sat, 16 Dec 2006 09:48:41 -0700 Bob van der Poel wrote:

> 
> A fellow asked me the other day "what is your total IP (up and down) per 
> month)?" I figured that since I was using Linux it'd be an easy answer 
> ... well, really I have no idea :)
> 
> I do have a little "net-applet" on my desktop which shows the total 
> since the last login (to the desktop, not the computer). Is there a log 
> file tracking this or a daemon I can install?
> 
> If it makes a difference I'm running Mandriva 2007.
> 
> Thanks.
> 
This might be what you want. http://www.ntop.org/overview.html

HTH Pedja

-- 
 People usually get what's coming to them ... unless it's been mailed.

Top    Back


Bob van der Poel [bob at mellowood.ca]
Sat, 16 Dec 2006 17:05:09 -0700

Predrag Ivanovic wrote:

> On Sat, 16 Dec 2006 09:48:41 -0700
> Bob van der Poel wrote:
> 
>> A fellow asked me the other day "what is your total IP (up and down) per 
>> month)?" I figured that since I was using Linux it'd be an easy answer 
>> ... well, really I have no idea :)
>>
>> I do have a little "net-applet" on my desktop which shows the total 
>> since the last login (to the desktop, not the computer). Is there a log 
>> file tracking this or a daemon I can install?
>>
>> If it makes a difference I'm running Mandriva 2007.
>>
>> Thanks.
>>
> This might be what you want.
> http://www.ntop.org/overview.html
> 
> HTH
> Pedja

Thanks guys ... a bit of more searching turned up this:

http://humdi.net/vnstat/

I've installed it and will try for a few days to see if this is doing what I want.

-- 
Bob van der Poel ** Wynndel, British Columbia, CANADA **
EMAIL: bob@mellowood.ca
WWW:   http://www.mellowood.ca

Top    Back


Benjamin A. Okopnik [ben at linuxgazette.net]
Sun, 17 Dec 2006 13:18:29 -0600

On Sat, Dec 16, 2006 at 09:48:41AM -0700, Bob van der Poel wrote:

> 
> A fellow asked me the other day "what is your total IP (up and down) per 
> month)?" I figured that since I was using Linux it'd be an easy answer 
> ... well, really I have no idea :)

Depends on what he meant, and on what you mean. Intellectual Property? Internet Protocol? Indigent Philadelphians? :)

If you're talking about counting the number of IP addresses from which you're being contacted, that's one (relatively easy to manage) problem. If you're talking about the amount of traffic between your computer and its upstream gateway (I'm guessing here, since 'IP' doesn't apply to this in any way, but for some reason, I suspect that this is what you mean.) If you're talking about something else, please enlighten us; I'm curious.

> I do have a little "net-applet" on my desktop which shows the total 
> since the last login (to the desktop, not the computer). Is there a log 
> file tracking this or a daemon I can install?

Again, I'm guessing "bytes per session". Just in case it is, you can always take a look at the output of 'ifconfig' for that interface, and add up the 'RX' (received) and the 'TX' (transmitted) bytes. I suppose that if you wanted the exact number of bytes logged somewhere, you could always run "iptables" with the "LOG" target - or even run a command that watches a given interface and records the amount of traffic. E.g.:

watch --no-title "/sbin/ifconfig eth0|/bin/grep bytes"
-- 
* Ben Okopnik * Editor-in-Chief, Linux Gazette * http://LinuxGazette.NET *

Top    Back


Raj Shekhar [rajlist2 at rajshekhar.net]
Mon, 18 Dec 2006 13:29:26 +0530

Benjamin A. Okopnik wrote:

> Again, I'm guessing "bytes per session". Just in case it is, you can
> always take a look at the output of 'ifconfig' for that interface, and
> add up the 'RX' (received) and the 'TX' (transmitted) bytes. I suppose
> that if you wanted the exact number of bytes logged somewhere, you could
> always run "iptables" with the "LOG" target - or even run a command
> that watches a given interface and records the amount of traffic. E.g.:
> 
> ``
> watch --no-title "/sbin/ifconfig eth0|/bin/grep bytes"
> ''

You can use sar <http://perso.orange.fr/sebastien.godard/> to do this too.

sar -n DEV
will show you a record of the packets and bytes flowing through your interfaces. There are scripts to sum up the usage and mail you reports about this. If you install this package on your system, you will need to add a cron for sadc (system activity data collector). Check your distro's readme file for the sar package on how you can enable the cron.
-- 
raj shekhar
facts: http://rajshekhar.net | opinions: http://rajshekhar.net/blog
I dare do all that may become a man; Who dares do more is none.

Top    Back


Suramya Tomar [security at suramya.com]
Sat, 23 Dec 2006 06:00:34 -0500

Hey,

>>> A fellow asked me the other day "what is your total IP (up and down) per 
>>> month)?" I figured that since I was using Linux it'd be an easy answer 
>>> ... well, really I have no idea :)
>>>
>>> I do have a little "net-applet" on my desktop which shows the total 
>>> since the last login (to the desktop, not the computer). Is there a log 
>>> file tracking this or a daemon I can install?
>>>

Here's a list of bandwidth monitoring tools available with descriptions of each. The list was created for ubuntu users but the tools are available for all distros.

http://www.ubuntugeek.com/bandwidth-monitoring-tools-for-ubuntu-users.html

Hope this helps.

- Suramya


Top    Back