[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: how to get process ids based on the port numbers it is using



On Tue, 1 Feb 2000, kamesh jayachandran wrote:
> I want to gather process id of the processes that are using the specific  
> ports in the server.Say I want to gather the process ids of the users who are 
> browsing the web by having 80 as the port number.
------------------------

actually, the question is mildly misstated. a process (and user on the
server) browsing the web would have a net connection with the remote port
set to 80 and the local port set to an arbitrary number. processes using
port 80 on the server would be connections from remote users trying to
access the web pages on the server. details of all the net connections can
be obtained by any user using netstat. this fool proof way will identify
all users trying to browse the web by looking for connections where the
remote port is 80. unfortunately, netstat only gives the local socket
number and not the pid of the process owning that local port number. i
suppose that information can be obtained from /proc.

sriram


---
Send e-mail to 'ilugc-request@xxxxxxxxxxxxxxxxxx' with 'unsubscribe' 
in either the subject or the body to unsubscribe from this list.