AW: Investigating processes on open ports

From: Pavic, Aleksander (Aleksander.Pavic@t-systems.com)
Date: Tue Dec 12 2006 - 07:43:47 EST


Hello
> -----Urspr|ngliche Nachricht-----
> Von: Mumdziev, Marijan [mailto:marijan.mumdziev@siemens.com]
> Gesendet: Dienstag, 12. Dezember 2006 12:58
> An: sunmanagers@sunmanagers.org
> Betreff: Investigating processes on open ports
> 4) I am trying to find out a little bit more with command
> /usr/local/bin/lsof -i :8080 (4444, 1098), but I do not get any output
> for these ports.

Normaly a lsof -i4:8080 should show you what you want.

Another Method is this one:
# for i in `ps -e|awk '{print $1}'`; do echo $i; pfiles $i | grep 'port:
8080'; done

It will print a list with all pid's (and some "cannot examine ..." lines,
don't care about this).
If you get a line like "sockname: AF_INET <ip> port: <port_number>" you found
the process that uses that port.
You find the pid of this process above this line.

hth,
Aleks
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:41:19 EDT