Question
Yone Moreno · Mar 4, 2021

Is there a recommended way to search if a port is used in each Instance / Namespace?

Hello,

Thanks for your time,

We would like to know if there is a recommended way to look for if a service has a port in use in each Instance's / Namespace's Production?

We ask because of currently if we need to look if a port is used, we check in Studio every Namespace (there are more than 5) and every Instance (there are four)

0
0 440
Discussion (3)3
Log in or sign up to continue

You should be able to use 'netstat -a' within the OS in order to see all of the ports currently in use.  It won't tell you what process is using it, but if you are simply looking for open ports then this is a quick way to do it

In addition to Ben's answer, 

on Windows: netstat -ano | find "LISTENING"

will in the far right column show the process ID of the listening process

on Linux: sudo netstat -pln | grep tcp

the last column shows the process name which is opened the port