Operating System - HP-UX
1819771 Members
3445 Online
109606 Solutions
New Discussion юеВ

Re: How do I find out what app is using a port ..

 
SOLVED
Go to solution
someone_4
Honored Contributor

How do I find out what app is using a port ..

Hello ..
I have a situation where I have port 1526
now in /etc/services it tells me that it is
sql_turbo 1526/tcp # Informix
Now our devel team is playing and trying to config Informix. But when they try to bring it up they it says that port 1526 is taken. But they also say that another informix app is not running. So how can I find out what is hitting port 1526?

Richard
10 REPLIES 10
Santosh Nair_1
Honored Contributor
Solution

Re: How do I find out what app is using a port ..

If you have lsof installed on the machine, you can do lsof -i TCP:1526 and it will tell you exactly which process has the port open. If you don't have lsof, get it ... you should be able to get it from either the HP porting center or better yet, download the source from ftp://vic.cc.purdue.edu/pub/unix/tools/lsof and compile it (fairly easy).

Hope this helps.

-Santosh
Life is what's happening while you're busy making other plans
Patrick Wallek
Honored Contributor

Re: How do I find out what app is using a port ..

Download and install lsof. It can tell you what process has what port open.

You can get it from any of the HPUX Software porting archives.

I generally use: http://hpux.cs.utah.edu
Uday_S_Ankolekar
Honored Contributor

Re: How do I find out what app is using a port ..

Hi,

lsof is the best utility for this. You can get this from HP-UX porting Centre website http://hpux.cs.utah.edu/hppd/

GoodLuck
-USA..
Good Luck..
James Beamish-White
Trusted Contributor

Re: How do I find out what app is using a port ..

Get a tool called lsof, ftp://vic.cc.purdue.edu/pub/tools/unix/lsof/, which will show you something similar to this:

# lsof -i
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
syslogd 261 root 5u inet 0x10191e868 0t0 UDP *:syslog (Idle)
rpcbind 345 root 4u inet 72,0x73 0t0 UDP *:portmap (Idle)
rpcbind 345 root 6u inet 72,0x73 0t0 UDP *:49158 (Idle)

(taken from Building a Bastion Host).

Cheers,
James
GARDENOFEDEN> create light
A. Clay Stephenson
Acclaimed Contributor

Re: How do I find out what app is using a port ..

Hi Richard:

The best tool for that is lsof. You can also do a netstat -a | grep 1526 but lsof will do much better.

Port numbers in the 1520's are very commonly used by Oracle listeners whether or not they are defined in /etc/services or the NIS services map.

If it ain't broke, I can fix that.
harry d brown jr
Honored Contributor

Re: How do I find out what app is using a port ..

For 10.20 and 11.00 get it here:

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.55/


for 11i get it here:

http://www.wiretapped.net/security/host-security/lsof/binaries/hpux/B.11.11/

live free or die

harry
Live Free or Die
James R. Ferguson
Acclaimed Contributor

Re: How do I find out what app is using a port ..

Hi Richard:

BTW, in case you didn't know, ports don't have to be declared in /etc/services to be used.

Regards!

...JRF...
linuxfan
Honored Contributor

Re: How do I find out what app is using a port ..

Hi Richard,

As others have mentioned, download lsof and install it. Its pretty useful and one of the MUST-HAVE tools.

If you want to download the binaries in swinstal format

http://hpux.ee.ualberta.ca/hppd/hpux/Sysadmin/lsof-4.55
or
http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/lsof-4.55

If you want it in the source code, check out the page
http://freshmeat.net/projects/lsof/

I avoid Vic Bell's purdue site because it does a reverse-DNS and would prevent downloads if it fails.

In any case check out the FAQ
ftp://sunsite.ualberta.ca/pub/Mirror/lsof/FAQ

and you can download the latest version of lsof (4.59)

ftp://sunsite.ualberta.ca/pub/Mirror/lsof/

-Regards
Ramesh
They think they know but don't. At least I know I don't know - Socrates
someone_4
Honored Contributor

Re: How do I find out what app is using a port ..

where do i get lsof for 64 bit?
harry d brown jr
Honored Contributor

Re: How do I find out what app is using a port ..