Operating System - HP-UX
1752777 Members
6228 Online
108789 Solutions
New Discussion юеВ

How can I find a "hung port" on a server?

 
Stuart Abramson_2
Honored Contributor

How can I find a "hung port" on a server?

One of the pesky DBAs came to me today and asked me if "any ports were hung" on the one of our servers.

Their Oracle Applications Web Server won't start, and one of the things that Oracle told them to look for was "hung ports".

I asked him for a list of ports to check, which he gave me. (7070, 8070, 8170, etc..)

So I wrote a script that did something like this:

..netstat -a | grep $PORT
..lsof -i TCP:$PORT

but what exactly should I look for?
..I see a lot of "ESTABLISHED"
................."LISTEN

I saw a few "FIN_WAIT_2", which I know is a bad thing, and we are researching them.

How do you "search for hung ports"?
4 REPLIES 4
Sridhar Bhaskarla
Honored Contributor

Re: How can I find a "hung port" on a server?

Hi,

There isn't any way to check if a port is hung or not. A port will be hung if the corresponding process is hung on the system.

One way is to do a 'telnet localhost port_number" to see if you get a response.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Kenneth Platz
Esteemed Contributor

Re: How can I find a "hung port" on a server?

Can Oracle tell you *which* port it's attempting to communicate with? I'm going to assume port 80, or 8000, or 8080, or the like.

If you know what port to look for, then attempting to find out what process(es) are using it, or if it is in a hung state gets MUCH simpler...
I think, therefore I am... I think!
Chris Watkins_1
Respected Contributor

Re: How can I find a "hung port" on a server?

Get lsof. It is an excellent tool for things like this:
http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/lsof-4.70/

Then use it to find out what has the port(s) open:

# lsof -i tcp:7070
# lsof -i udp:7070
Not without 2 backups and an Ignite image!
Chris Watkins_1
Respected Contributor

Re: How can I find a "hung port" on a server?

Just shoot me now... no need to wait until later.
(I must learn to read more carefully)


lsof should show you the PIDs.
I don't know what else you could need.
If a port is open at all, it's unusable for another process.
So kill the process using the port, or have the DBA's
use different ports, if the process currently using it
is one that you don't want to kill or change ports on.
Not without 2 backups and an Ignite image!