Tricky situation getting IP address

Hi,

I have a multihomed system HP-UX with two NIC cards having IP address 10.9.0.13 & 10.9.0.45

I have two weblogic servers running one listening on "10.9.0.13" and the other on "10.9.0.45"

Given a PID how is it possible to extract the IP Address that the weblogic server is using and store it in a bash variable "myh" ?

I am looking for a solution for HP-UX and then for all Linux and Unix systems so if you could share some solution for HP-UX and others as well.

If you have lsof installed you can get very useful information out of that.

You can get lsof as a free download from sourceforge I think.

lsof -o -p PID

If you know the port that it connects on, you could use netstat:-

netstat -na|grep "\.port "

I hope that this helps.

Robin
Liverpool/Blackburn
UK