Link to home
Start Free TrialLog in
Avatar of LindaC
LindaCFlag for Puerto Rico

asked on

Script needed to see the ports being used by the Aix server.

I'am expecting something like this:

"Run this script as root so that you will have in a text file, the ports that are being used"
After you add the proper comments to this text file  adding this to each line (example)
    # Comment-This port is for Oracle Apex
then you run this  other script to add the content of this text file to the /etc/services.
This must be run by root.
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

you may look at the output of command like

netstat -an

can you elaborate on the requirement?
Avatar of LindaC

ASKER

It will suffice if I can get a text file with all the ports that are in use on the server.
The other ports that are not in the text files will be closed.
Avatar of LindaC

ASKER

Only the text files with the ports that are being used.
ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
try this

netstat -an | egrep -i "list|estab|connect" > file

this should give you idea about ports used on the system
Avatar of LindaC

ASKER

Does this udp means that they are being used?

udp        0      0  *.46656                *.*
claropr-oem-oracle:/oracle/diag/rdbms/oem11g/oem11g/trace> an|grep 14253
udp        0      0  *.14253                *.*
ports-used.bmp
udp is the protocol being used (User Datagram Protocol)

The simple fact that the port appears in the output of "netstat -an" means that it's open and in use.
Avatar of LindaC

ASKER

Thank you.