This is easiest done with lsof. On Solaris you can use pfiles, and you may also find netstat -anlp on Linux useful.
First, find the PID of the process you’re interested in
|
1 2 |
# ps -ef | grep '[v]m' root 32702 1 0 Mar08 ? 00:00:00 /usr/bin/vmpsd |
Then, run lsof against the PID
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
# lsof -p 32702 COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME vmpsd 32702 root cwd DIR 9,1 4096 2 / vmpsd 32702 root rtd DIR 9,1 4096 2 / vmpsd 32702 root txt REG 9,1 23708 881217 /usr/bin/vmpsd vmpsd 32702 root mem REG 0,0 0 [heap] (stat: No such file or directory) vmpsd 32702 root mem REG 9,1 1184892 1024170 /lib32/libc-2.4.so vmpsd 32702 root mem REG 9,1 124785 1024169 /lib32/ld-2.4.so vmpsd 32702 root 0u CHR 136,0 2 /dev/pts/0 (deleted) vmpsd 32702 root 1u CHR 136,0 2 /dev/pts/0 (deleted) vmpsd 32702 root 2u CHR 136,0 2 /dev/pts/0 (deleted) vmpsd 32702 root 3u IPv4 4214826 UDP *:1589 vmpsd 32702 root 4u unix 0xffff81007d816300 4214827 socket |
Port 1589/UDP, that’s the information we wanted.