List Process tied to Port: Difference between revisions

From UNIX Systems Administration
Jump to navigation Jump to search
(Created page with "# Determine the <tt>'''tcpcb'''</tt> (TCP Control Block) tied to the port. ## <tt>'''# netstat -Aan -f inet'''</tt> ##")
 
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
== List a Processes tied to a Port ==
# Determine the <tt>'''tcpcb'''</tt> (TCP Control Block) tied to the port.
# Determine the <tt>'''tcpcb'''</tt> (TCP Control Block) tied to the port.
## <tt>'''# netstat -Aan -f inet'''</tt>
##: <tt>'''# netstat -Aan -f inet'''</tt>
##
## The output should be similar to the following.
##: <tt>'''Active Internet connections (including servers)'''</tt>
##: <tt>'''PCB/ADDR        Proto Recv-Q Send-Q  Local Address      Foreign Address    (state)'''</tt>
##: <tt>'''f1000e0000527bb8 tcp        0      0  *.*                  *.*                  CLOSED'''</tt>
##: <tt>'''f1000e00005233b8 tcp4      0      0  *.*                  *.*                  CLOSED'''</tt>
##: <tt>'''f1000e001380dbb8 tcp4      0      0  *.13                  *.*                  LISTEN'''</tt>
##: <tt>'''f1000e0007a133b8 tcp        0      0  *.21                  *.*                  LISTEN'''</tt>
##: <tt>'''f1000e0000f28bb8 tcp6      0      0  *.22                  *.*                  LISTEN'''</tt>
##: <tt>'''f1000e0000f283b8 tcp4      0      0  *.22                  *.*                  LISTEN'''</tt>
## The first column <tt>'''PCB/ADDR'''</tt> will be used.
## The <tt>'''rmsock'''</tt> command will be used to identify the process associated with the TCPCB.
##: <tt>'''# rmsock <PCB/ADDR> tcpcb'''</tt>
## The output will be similar to the following.
### <tt>'''The socket 0xf1000e0000527808 is being held by proccess 5505230 (rmcd).'''</tt>
## Example.
##: <tt>'''# rmsock f1000e0000527bb8 tcpcb'''</tt>
 
== Further Reading ==
* [http://aixblogs.blogspot.com/2009/03/using-netstat-and-rmsock-to-identify.html Using netstat and rmsock to Identify Processes]
 
[[Category: AIX]]

Latest revision as of 17:06, 28 November 2017

List a Processes tied to a Port

  1. Determine the tcpcb (TCP Control Block) tied to the port.
    1. # netstat -Aan -f inet
    2. The output should be similar to the following.
      Active Internet connections (including servers)
      PCB/ADDR Proto Recv-Q Send-Q Local Address Foreign Address (state)
      f1000e0000527bb8 tcp 0 0 *.* *.* CLOSED
      f1000e00005233b8 tcp4 0 0 *.* *.* CLOSED
      f1000e001380dbb8 tcp4 0 0 *.13 *.* LISTEN
      f1000e0007a133b8 tcp 0 0 *.21 *.* LISTEN
      f1000e0000f28bb8 tcp6 0 0 *.22 *.* LISTEN
      f1000e0000f283b8 tcp4 0 0 *.22 *.* LISTEN
    3. The first column PCB/ADDR will be used.
    4. The rmsock command will be used to identify the process associated with the TCPCB.
      # rmsock <PCB/ADDR> tcpcb
    5. The output will be similar to the following.
      1. The socket 0xf1000e0000527808 is being held by proccess 5505230 (rmcd).
    6. Example.
      # rmsock f1000e0000527bb8 tcpcb

Further Reading