LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 10-02-2009, 03:00 PM   #1
lildee
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.
Thanks.

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

Rep: Reputation: 227Reputation: 227Reputation: 227
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, 07:03 AM   #3
lildee
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 01:15 AM.
 
  


Reply

Tags
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 12:26 PM
Blocking outgoing traffic from a specific port billy3 Linux - Security 10 09-24-2004 09:10 PM
Blocking Traffic on a specific port (kazaa) GratePayne Linux - Security 4 05-09-2004 10:10 AM
specific port traffic graph using mrtg newpenguin Linux - Networking 7 12-16-2003 07:00 PM
Monitoring a Specific Port and Exporting to a log file chrisfirestar Linux - General 0 10-27-2003 05:17 AM


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

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