ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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.
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.