Polling eth0?

D

Dennis Craven

Hello,

I intend on writing a small application that monitors incoming/outgoing
traffic on eth0, and recording the bandwidth usage with monthly
totals etc..

Where would be a good place to start in regards to connecting to
eth0 and reading such data? I am somewhat familiar with Python, and
its simple constructs, but I'm not so familiar with this network
aspect.

Any particular modules/examples/documentation/tutorials that I should
start out reading?

Thanks,
~djc
 
P

Peter Hansen

Dennis said:
I intend on writing a small application that monitors incoming/outgoing
traffic on eth0, and recording the bandwidth usage with monthly
totals etc..

Where would be a good place to start in regards to connecting to
eth0 and reading such data?

I would most definitely do this with appropriate calls to "iptables",
specifically using the -Z option with -L, which is designed specifically
for this kind of thing.

(If you aren't familiar with it, it's a Linux firewall command, not
anything to do with Python. You could use os.popen() to call it
from Python though, and capture the output.)

-Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,017
Latest member
GreenAcreCBDGummiesReview

Latest Threads

Top