Finding network process name/pid

From: John Horne (john.horne@plymouth.ac.uk)
Date: Fri Aug 17 2007 - 06:01:42 EDT


Hello,

The 'netstat -an' command will show me that processes are using certain
network ports. E.g. 'netstat -an | grep 53' will show me that a DNS name
server is running:

   127.0.0.1.53 Idle
   192.168.177.1.53 Idle
   192.168.177.1.53 *.* 0 0 49152 0 LISTEN

But how can I find out the process (executable) pathname or its PID?

I am trying to write something in a shell script, which will work for
standard Solaris 9 or 10 systems. I know that 'lsof' can do this, but
that is not part of a standard Solaris system (i.e. just using the
software on Sun's installation CD's/DVD). I am looking either for
something like the netstat '-p' option on Linux systems, or if there is
some way of digging the information out of /proc (although that may mean
going through all the processes in /proc). Perhaps using one of
the /proc tools/commands.

A first look at this problem, and I don't actually think it can be done.
I just want to make sure by asking you all. I have read the FAQ, and I
know it asks this very question, but the answer given there is to use
'lsof'. I want to know if there is another way.

Thanks,

John.

-- 
---------------------------------------------------------------
John Horne, University of Plymouth, UK  Tel: +44 (0)1752 233914
E-mail: John.Horne@plymouth.ac.uk       Fax: +44 (0)1752 233839
_______________________________________________
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:42:13 EDT