Visit Jeremy's Blog.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 10-02-2009, 02:00 PM   #1
LQ Newbie
Registered: Oct 2009
Posts: 2

Rep: Reputation: 0
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.

Last edited by lildee; 10-03-2009 at 05:24 AM.
Old 10-02-2009, 02:26 PM   #2
Senior Member
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 231Reputation: 231Reputation: 231
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 !
Old 10-03-2009, 06:03 AM   #3
LQ Newbie
Registered: Oct 2009
Posts: 2

Original Poster
Rep: Reputation: 0
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?

Last edited by lildee; 10-04-2009 at 12:15 AM.


monitor, network, python

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[HELP] redirect traffic to spesific port based on Traffic Content using iptables summersgone Linux - Server 2 06-22-2009 11:26 AM
Blocking outgoing traffic from a specific port billy3 Linux - Security 10 09-24-2004 08:10 PM
Blocking Traffic on a specific port (kazaa) GratePayne Linux - Security 4 05-09-2004 09:10 AM
specific port traffic graph using mrtg newpenguin Linux - Networking 7 12-16-2003 06:00 PM
Monitoring a Specific Port and Exporting to a log file chrisfirestar Linux - General 0 10-27-2003 04:17 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:36 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration