sockstat and unix sockets

Hi
How to see which processes are connected to which listening processes?

for example:
process A (connected processes: x, y, z..)
process B (no connected process)

Is it possible?
 
Doesn't sockstat do that by default?
Anyway...

Code:
man sockstat
says:
Code:
-u          Show AF_LOCAL (UNIX) sockets.

If neither -c or -l is specified, sockstat will list both listening and connected sockets.

Hope that helps :)
 
I'd like to see the associations among clients and server

I'm not really sure what you mean, but sockstat will tell you the name of the unix process that's listening - server? - and the IP address of a remote machine that's connected - client? - e.g. for IPv4 on port 443
Code:
% sockstat -p 443 -s -4
USER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN ADDRESS       PATH STATE   CONN STATE 
www      nginx      97042 3  tcp4   192.168.1.87:443      192.168.1.64:60910                 ESTABLISHED
www      nginx      97042 8  tcp4   *:443                 *:*                                LISTEN
 
Back
Top