LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   monitoring traffic on specific port (https://www.linuxquestions.org/questions/programming-9/monitoring-traffic-on-specific-port-759256/)

lildee 10-02-2009 02:00 PM

monitoring traffic on specific port
 
Hi guys,

I've been working on building a program that monitors the network traffic on my local machine. All this program does is:
- shows the total amount of transmitted and received data on an interface eg.(eth1)
- shows the overall incoming and outgoing data transfer rate on an interface (realtime)

I can do the above by reading the /proc/net/dev system file. But now I would like to add another function where my program can show the incoming and outgoing transfer rate of each port for example port 80 or port 25 (specified by user). I don't think there is any information in the /proc/net system files that can be used to show the transfer rate on each port. What could be the simplest way to do this?
Im using python as my programming language for this program btw.
Thanks.

bgeddy 10-02-2009 02:26 PM

You may find speedometer interesting. It's a python program that seems to do exactly what you want. I've not used it so I can't remark on it but it looks interesting. If nothing else it may give you some useful ideas !

lildee 10-03-2009 06:03 AM

Thanks for pointing out speedometer. I've looked into speedometer and it is very similar to my program that I'm working on. It has the same function with my program but it doesn't monitor the traffic on different ports. I'm searching for a solution to monitor traffic on specific ports. For example when a user wants to monitor the http port (port 80), my program should be able to display the traffic activity for only port 80. Any ideas?


All times are GMT -5. The time now is 07:03 AM.