Operating System - HP-UX
1834814 Members
2589 Online
110070 Solutions
New Discussion

Re: port related information

 
SOLVED
Go to solution
Shivkumar
Super Advisor

port related information

Hey Guys,

I know hpux keeps port related information in /etc/services file.

Is there any other place where port related information are stored on hpux11i ?

Thanks in advance!
Shiv
6 REPLIES 6
Patrick Wallek
Honored Contributor
Solution

Re: port related information

It depends.

Some applications listen on specific ports when they are started (Apache is an example) and don't have /etc/services entries. The Apache port information is kept in httpd.conf. Each application could have something in its own configuration file.
Bejoy C Alias
Respected Contributor

Re: port related information

Most of the standard ports are listed in /etc/services . For the other ports the info will be in the config files of that applications
Be Always Joy ......
Simon Hargrave
Honored Contributor

Re: port related information

A useful tool is "lsof". This is used to show open files on a process (or all processes), which includes listening TCP ports.

So, if you run:

# lsof -i | grep LISTEN

you will get a list of all the TCP ports all processes on your server are currently listening to. Output will be something like this:

inetd 1255 root 5u inet 0x434364c0 0t0 TCP *:ftp (LISTEN)
inetd 1255 root 6u inet 0x43436640 0t0 TCP *:telnet (LISTEN)
itaagtd 1762 root 4u inet 0x43a256c0 0t0 TCP *:5052 (LISTEN)
diaglogd 19958 root 1u inet 0x540e5940 0t0 TCP *:62742 (LISTEN)
memlogd 19959 root 0u inet 0xcd846e80 0t0 TCP *:62745 (LISTEN)

Can be a very useful tool for this sort of thing. You can download it for free from here:

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.74/
Rick Garland
Honored Contributor

Re: port related information

The /etc/services is the main place to get the port info. Most applications that go through an installation process will append their port information to the /etc/services.

As mentioned, get the lsof tool. This can provide much information as to port usage.

C. Beerse_1
Regular Advisor

Re: port related information

/etc/services is the formal list of ports that can be used.

Lots of apps have their own configuration (or command-line option) which port is used for what, either with the direct port number or with the name as defined in /etc/services (like inetd / xinetd).

In the end, use `netstat -a` to list the active usage.
make everything as simple as possible, not simpler (A.Einstein??)
KVK
Valued Contributor

Re: port related information

/etc/services is the only file which hp-ux refers about the port information . No where else it will be . Even if u install the thirty party application u can see the new port column will be added into it ....
In replies u can find lsof & netstat as well as
protocals information also find by
#netstat -s