monitoring traffic on specific port
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.
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 !
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:33 AM.|