1833294 Members
3738 Online
110051 Solutions
New Discussion

Re: netstat -a output

 
SOLVED
Go to solution
Todd Lehr
Frequent Advisor

netstat -a output

How can one get the netstat -a command in HP-UX 11 to output a fully qualified hostname ( or at least part of it). This is how it works in 10.20, however the functionality appears to have changed in 11.x
6 REPLIES 6
harry d brown jr
Honored Contributor

Re: netstat -a output


Drop netstat use lsof:

http://gatekeep.cs.utah.edu/hppd/hpux/Sysadmin/lsof-4.64/

it's a lot more useful!

live free or die
harry
Live Free or Die
steven Burgess_2
Honored Contributor
Solution

Re: netstat -a output

Hi

Drop the options and you get the hostnames but less info.

netstat

man netstat for more

As Harry advises get lsof

Here are it's uses

To see all open files of a paricular process (via its pid):

# lsof -p

To see all open files associated with a command:

# lsof -c cron

...or by a logon name:

# lsof -u
# lsof -u

...or what process is using a TCP socket:

# lsof -i tcp:161
# lsof -i udp:161

HTH

Steve

take your time and think things through
Todd Lehr
Frequent Advisor

Re: netstat -a output

Thanks for the answers, can't use lsof but running just netstat works, not sure why I didn't try that first however.
harry d brown jr
Honored Contributor

Re: netstat -a output

Why can't you use lsof??????

live free or die
harry
Live Free or Die
Todd Lehr
Frequent Advisor

Re: netstat -a output

corporate policy, unless it's distributed with the operating system, or offically support software it's hard to get approval to load it onto the system.
harry d brown jr
Honored Contributor

Re: netstat -a output

Yeah, I fought that battle, but I won. I simply explained to them that most of HPux is not owned by HP, and some things aren't owned by anyone.

Are you using netscape? java? perl? ftp? tcp/ip? vi? sed? awk? any gnu utilities? X windows? telnet? rlogin? html? .......


:-)


live free or die
harry
Live Free or Die