Re: [Ilugc] Net Traffic Log

2012-06-25 Thread Balasubramaniam Natarajan
On Sat, Jun 23, 2012 at 11:37 PM, Harisankar P S mai...@hsps.in wrote:

 Hey,

 Is there a way to keep track of the network traffic through all the
 different interface devices in my system. Or a library to do so, I want to
 create a log that store the total size of file transfered since the script
 or program starts running.


vnstat is also good at it.

vnstat -i eth0 -d

 eth0  /  daily

 day rx  | tx  |total|   avg. rate
 +-+-+---
  05/27/12 28.17 MiB |5.02 MiB |   33.19 MiB |3.15 kbit/s
  05/28/12 0 KiB |   0 KiB |   0 KiB |0.00 kbit/s
  05/29/12 20.62 MiB |3.32 MiB |   23.94 MiB |2.27 kbit/s


-- 
Regards,
Balasubramaniam Natarajan
www.etutorshop.com/moodle/
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


Re: [Ilugc] Net Traffic Log

2012-06-25 Thread Bharathi Subramanian
On Sun, Jun 24, 2012 at 2:07 AM, Harisankar P S wrote:

 Is there a way to keep track of the network traffic through all the
 different interface devices in my system. Or a library to do so, I want to
 create a log that store the total size of file transfered since the script
 or program starts running.

May be a script that monitor the Rx/Tx packet counts from ifconfig
output. You can start and stop this script along with your target
application.

Bye :)
-- 
Bharathi Subramanian
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


Re: [Ilugc] Net Traffic Log

2012-06-24 Thread Arun Khan
On Sat, Jun 23, 2012 at 11:37 PM, Harisankar P S mai...@hsps.in wrote:
 Hey,

 Is there a way to keep track of the network traffic through all the
 different interface devices in my system. Or a library to do so, I want to
 create a log that store the total size of file transfered since the script
 or program starts running.

bandwidthd  does this with nice graphics.Most tools measure the
traffic over and interface; on an individual file basis I don't know.
 It tracks the total data over an interface by protocol.

More details see http://sourceforge.net/projects/bandwidthd/

-- Arun Khan
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


Re: [Ilugc] Net Traffic Log

2012-06-24 Thread Suraj Kumar
On Sat, Jun 23, 2012 at 11:37 PM, Harisankar P S mai...@hsps.in wrote:

 Hey,

 Is there a way to keep track of the network traffic through all the
 different interface devices in my system. Or a library to do so, I want to
 create a log that store the total size of file transfered since the script
 or program starts running.


Check out Collectd: http://collectd.org/

cheers,

  -Suraj

-- 
Career Gear - Industry Driven Talent Factory
http://careergear.in/
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


[Ilugc] Net Traffic Log

2012-06-23 Thread Harisankar P S
Hey,

Is there a way to keep track of the network traffic through all the
different interface devices in my system. Or a library to do so, I want to
create a log that store the total size of file transfered since the script
or program starts running.


-- 
Harisankar P S
http://tech.hsps.in
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


Re: [Ilugc] Net Traffic Log

2012-06-23 Thread 0

 Is there a way to keep track of the network traffic through all the
 different interface devices in my system. Or a library to do so, I want to
 create a log that store the total size of file transfered since the script
 or program starts running.


By default, iptables keeps track of the number of bytes and packets for 
each rule. You can use the option -vx to display them. In your case, 
based on what the script does, you can add an iptables rules matching 
the network activity which will keep track of number of bytes and 
packets. You can reset the counters using -Z option. Here is a sample 
output from iptables,

$ sudo iptables -vxnL INPUT|tr -s ' '|cut -d  -f14,2-4|tr ' ' '\t'

pktsbytes   target
623 51632   ACCEPT
111 6362ACCEPT
77  4620ACCEPT
13454   805868  ACCEPT  dpt:22
3500182164  ACCEPT  dpt:15025
166 9936ACCEPT  dpt:15465
1   60  ACCEPT  dpt:15587
3768199107  ACCEPT  dpt:15993
3417176023  REJECT

The article below may help, it seems to talk about traffic accounting 
with iptables,

http://www.catonmat.net/blog/traffic-accounting-with-iptables/

-- 
0
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


Re: [Ilugc] Net Traffic Log

2012-06-23 Thread Girish Venkatachalam
On Sun, Jun 24, 2012 at 9:04 AM, 0 0...@0throot.com wrote:

 Is there a way to keep track of the network traffic through all the
 different interface devices in my system. Or a library to do so, I want to
 create a log that store the total size of file transfered since the script
 or program starts running.


 By default, iptables keeps track of the number of bytes and packets for
 each rule. You can use the option -vx to display them. In your case,
 based on what the script does, you can add an iptables rules matching
 the network activity which will keep track of number of bytes and
 packets. You can reset the counters using -Z option. Here is a sample
 output from iptables,

 $ sudo iptables -vxnL INPUT|tr -s ' '|cut -d  -f14,2-4|tr ' ' '\t'
 
 pkts    bytes   target
 623     51632   ACCEPT
 111     6362    ACCEPT
 77      4620    ACCEPT
 13454   805868  ACCEPT  dpt:22
 3500    182164  ACCEPT  dpt:15025
 166     9936    ACCEPT  dpt:15465
 1       60      ACCEPT  dpt:15587
 3768    199107  ACCEPT  dpt:15993
 3417    176023  REJECT

 The article below may help, it seems to talk about traffic accounting
 with iptables,

 http://www.catonmat.net/blog/traffic-accounting-with-iptables/


Very good idea. Usually netflow is used for this purpose.

Various commercial and open source tools are available based on Cisco Netflow
protocol.

-Girish

-- 
Gayatri Hitech
http://gayatri-hitech.com
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc