But I though Nick wanted to map the process ID to the port. I'm assuming he's running a "ps" or similar, finding a gcc process with a specific PID, and now wants to find the listen port for the GCC with that pid (assuming there could be many gcc's running on the system).
If this is the case, one way wold be to run
Code:
netstat -p -a | grep <pid>
This would show the socket listen address of the gcc with the given process ID. Of course we're working backwards so we can't use the iimonitor trick. The only way I can see is to run:
Code:
grep <tcp_socket_number> $II_SYSTEM/ingres/files/errlog.log
This would display the network open line from the log, you could grep also for E_GC2815 to narrow it down. This line will give you the GCC port ID (the first number after the square braces).
with the right grep, awk, or sed tricks you could create a script that gave you one number from the other.