0

I have a Abinitio process running on a Red hat server.

This process is basically a webservice, which is bound to a port on this running unix server. The front end sends request to this UNIX PORT, which is in turn read by abinitio process and processed further.

How can I identify if the process is bound to the unix port or not?

I face a weird situation every Monday(over the weekend), When I try to hit the webservice through SOAP , I get socket timeout exception. TO solve this I have to stop and start the process.

I want to identity which all sockets are not responding , given the list of ports.

NishantM
  • 141
  • 12

3 Answers3

1

netstat -lnp will list the pid and process name next to each listening port. This will work under Linux, but not all others (like AIX.) Add -t if you want TCP only.

root@c27bf9ed63c5:/# netstat -lnpt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address        Foreign Address      State       PID/Program name
tcp6       0      0 127.0.0.1:8005       :::*                 LISTEN      1/java
tcp6       0      0 :::8009              :::*                 LISTEN      1/java
tcp6       0      0 :::8080              :::*                 LISTEN      1/java
cjuette
  • 31
  • 5
  • What would it mean if the response does not have any process mentioned. I received '-' after LISTEN. I am receiving same response with netstat -nlp command for both the case, one for the port I am able to receive response and for the other where timeout socketException is received through SOAP :( – NishantM Feb 20 '17 at 13:10
  • I just checked again in Ubuntu and got the the expected output next to LISTEN. I will edit my answer to show the output. What kind of Linux are you using - as I stated it will not work on all derivates? – cjuette Feb 21 '17 at 17:00
0

Since this is on a UNIX, lsof -i :port_number will give you details of what process is bound to the given port

Noufal Ibrahim
  • 71,383
  • 13
  • 135
  • 169
0

Use netstat command.

netstat -anp | grep pid

You can also use the nmap to check which ports are listening for a machine.

nmap -sT -O machine_ip