Operating System - HP-UX
1832935 Members
2863 Online
110048 Solutions
New Discussion

netstat date/time a port was opened?

 
Craig A. Sharp
Super Advisor

netstat date/time a port was opened?

Is there a way to get the date and time a port was opened using netstat or is there a better piece of 'ware out there that can give me better info than netstat?
3 REPLIES 3
Steven E. Protter
Exalted Contributor

Re: netstat date/time a port was opened?

Shalom,

Check the man page, but I think the answer to your question is no.

You might be able to find this with ethtool/wireshark or tcpdump port ## (replace the ## with a real port number).

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Aussan
Respected Contributor

Re: netstat date/time a port was opened?

netstat and lsof will give you info about the port but not the date and time, however if you know what is using the port

example port 21 is used by ftp

you can take a look at syslog.log and see the date and time of the ftp session.

i hope this helps

Regards

Aussan
The tongue weighs practically nothing, but so few people can hold it
rick jones
Honored Contributor

Re: netstat date/time a port was opened?

Neither netstat, nor the underlying transport has that information.

I suspect there may be auditing levels which are high enough that you could see when the socket() and/or bind() calls (I am assuming that is what you mean by "time a port is opened" were made, but that is actually conjecture, for as a performance guy I rarely if ever enable auditing.

If you want to know when a connection was established, you could in theory sniff the network traffic looking for the SYNs and see the timestamps. That has a non-trivial CPU overhead.

To what end do you wish to know this information?
there is no rest for the wicked yet the virtuous have no pillows