Operating System - HP-UX
1830477 Members
2396 Online
110005 Solutions
New Discussion

finding ipadress for a given pid

 
bhavin asokan
Honored Contributor

finding ipadress for a given pid

hi all,

how to find the ipaddress of the system from where a process initated .in the tty column it is giving a ? symbol only.this is an oracle process and it is showing pid=26186 ppid=1.

regds,
3 REPLIES 3
Con O'Kelly
Honored Contributor

Re: finding ipadress for a given pid

Hi

The 'TTY' column only shows what terminal the process is controlled from on the local system (if any). In most instances it will be '?' meaning that no terminal is controlling that process. The 'TTY' column will never show an IP address.

Not exactly sure what you are after but you may have some success using:
# lsof -i | grep " 26186 "

(Note lsof must be installed on your system)

Cheers
Con
Bharat Katkar
Honored Contributor

Re: finding ipadress for a given pid

Hi,
If it showing "?" then mostly its a system Process or daemon started by the your System itself. To know IP Address of your System's NIC :

# ifconfig lan0
or whatever interface you use. lan1,lan2,..

You can trace the IP of remote telnet session then use:

# ps -ef
Identify the tty no. e.g. if it is pts/ta then

# who -R | grep pts/ta

Hope this is what you are looking for.
Regards,

You need to know a lot to actually know how little you know
Muthukumar_5
Honored Contributor

Re: finding ipadress for a given pid

Hai,

We can idenitify the ip-address by relating two commands ps and who as

# Give the PID
PID=$1

who -Ru | grep `ps -aefl | grep -v grep | grep $PID | awk '{print $13}' | uniq`

It will give all the informations.

By default, process tty with ? are enabled by system.

If you want to get the tty only, use the ps with out who command.

Regards,
Muthukumar.
Easy to suggest when don't know about the problem!