Operating System - HP-UX
1834166 Members
2426 Online
110064 Solutions
New Discussion

Re: Checking application on particular port

 
n00body
Advisor

Checking application on particular port

Hi Gurus ... do you know how to define which application is binding to specific port other than checking at /etc/services .

For example .. i'm trying to check the application that utilize high WAN utilisation between these 2 nodes .. i captured the netstat

$ netstat -an | grep 243.69

tcp 0 11 10.243.11.153.59619 10.243.69.117.52828 ESTABLISHED

tcp 0 0 10.243.11.153.49198 10.243.69.117.5555 ESTABLISHED

tcp 0 0 10.243.11.153.50373 10.243.69.117.5555 ESTABLISHED

tcp 0 0 10.243.11.153.59619 10.243.69.117.53876 ESTABLISHED


I only able to grep 5555 info from the /etc/services whilst the port 53876 & 52828 yield no info from the /etc/services .

Regards ,
n0body
6 REPLIES 6
Ivan Krastev
Honored Contributor

Re: Checking application on particular port

Use lsof utility:

lsof -i tcp | grep port

Second columd is a PID.

regards,
ivan
Aneesh Mohan
Honored Contributor

Re: Checking application on particular port

n00body
Advisor

Re: Checking application on particular port

Unfortunately the server that I'm administering have no lsof installed .:( . Its gonna be long way to go to get the permission through change request to install this helpful tool . That's why I was relying on netstat .. :( .Is there any other native way that I can use ? Anyway .. thanks guys .
Torsten.
Acclaimed Contributor

Re: Checking application on particular port

The file /etc/services lists "well known ports", see

http://www.iana.org/assignments/port-numbers

Ports in range from 49152 through 65535 are Dynamic and/or Private Ports (not listed in /etc/services).

Some of them are related to OS components, example:

# lsof -i tcp |grep 59790
diaglogd 22974 root 1u IPv4 0x4031c40 0t0 TCP *:59790 (LISTEN)

...

dm_stape 23283 root 5u IPv4 0x44695c0 0t15229 TCP localhost:59834->localhost:59792 (ESTABLISHED)


(these are online diagnostics processes).




Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Srimalik
Valued Contributor

Re: Checking application on particular port

try:
netstat -ap

This works under linux.
abandon all hope, ye who enter here..
Tim Nelson
Honored Contributor

Re: Checking application on particular port

unless you specifically put a name for this service in the /etc/servicees file your only option is a enhancement product.

lsof is the most common and works great. Delivered on HPUX IExpress CDs or via software.hp.com