[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Viewing socket owner



On 5/1/05, Matthew Clarke <clamat_(_at_)_telus_(_dot_)_net> wrote:
> dimanche, le 1 mai, 2005, Arnaud Bergeron nous a dit ceci:
> 
> > I have been playing around with netstat and found lots of strange
> > (read uknown ports) udp connections.  I wanted to know what processes
> > where doing these connections.  After reading the netstat man page I
> > concluded that it can't do it.  Google provided no useful information.
> >
> > So I wonder if there is a way to view the pid (or pgid) of the owner
> > of a socket other than writing my own program to read kernel memory
> > with kvm_*.
> 
> see fstat(1)
> 
> Example:
> 
> % netstat -nafinet -pudp
> Active Internet connections (including servers)
> Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)
> udp        0      0  *.177                  *.*
> udp        0      0  *.38387                *.*
> udp        0      0  *.514                  *.*
> 
> % fstat | grep udp
> root     xdm        26128    5* internet dgram udp *:177
> _ntp     ntpd       27573    4* internet dgram udp *:38387
> _syslogd syslogd    11597    3* internet dgram udp *:514
> %
> 
> Matt.
> --
> For a successful technology, reality must take precedence over public
> relations, for nature cannot be fooled.
>                                 -- Richard P. Feynman
> 
> 
Thanks for the answer it just didn't pop in my research.

Arnaud Bergeron
-- 
   Fourth law of programming:
   Anything that can go wrong wi
sendmail: segmentation violation - core dumped



Visit your host, monkey.org