Quickly mapping connecting IP to PID
2007-12-25 0:10:00
I have an application that listens on the network and spawns a new child
for each network connection.
I need to find a fast way to map each connecting IP to the PID of the
child that was spawned.
At first I thought 'lsof' would be ideal, but it takes far too long.
For each IP I give it, it takes up to 8 seconds to respond. The -C flag
can knock maybe a second off this, but that's still slow.
Ideally it wouldn't take more than a second or three to respond will all
the PIDs (there can be multiple connections thus multiple children).
Does anyone know how else I can achieve the results I want?
Linux netstat has the '-p' flag which does this :-(
--
Avleen Vig:
Work Time: Unix Systems Admin Email: work at silverwraith.com
Play Time: Network Security Admin Pager: av-pager, at silverwraith com
Smurf Amplifier Finding Executive: http://www.ircnetops.org/smurf
Comments
Got something to say?
You must be logged in to post a comment.

