[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [hobbit] netstat commands and output on AIX, HP-UX, Darwin, OSF/1



Hi Henrik,
i send you the output for AIX 5.2 and 4.3.

--
Gianluca


Henrik Stoerner wrote:
I'm merging some code I got 6 months ago for checking the "netstat"
output for what ports are being used - both for active connections
and listen-ports.

For that, I need the "netstat" commands to put into the client code,
and an example of the output so I can tell the client-module how to
interpret the data.

I'm only interested in TCP ports. I have the data I need for Linux,
Solaris and the BSD variants, but I would like them also for AIX,
HP-UX, Darwin and OSF/1.

So I need:
* The "netstat" command to run to get the set of TCP ports currently
in use, including ports used for incoming connections. Typically
this will be some sort of "netstat -na", with some extra options
to get only the TCP sockets.
Note that it may be necessary to run two commands to get both
IPv4 and IPv6 ports. On the BSD's, I noticed that connections to the loopback interface register as IPv6 sockets, not IPv4.


* A sample of the output, so I can see which columns the various
  data go into.


Anyone there who could get me this info ?


Thanks, Henrik


PS: This lets you setup rules in hobbit-clients to track eg the
number of connections to your webserver, and put this into
a graph so you can see the activity over the day. It can also alert you if there is a port 25 open on a server where
it shouldn't be, or if the number of connections to your
ssh daemon goes above 20.




To unsubscribe from the hobbit list, send an e-mail to
hobbit-unsubscribe (at) hswn.dk



wwwsvil#uname -a
AIX wwwsvil 2 5 005E147C4C00
wwwsvil#netstat -na | grep tcp | head
tcp4       0      0  172.28.103.42.22       172.28.103.42.38225    ESTABLISHED
tcp        0      0  172.28.103.42.38225    172.28.103.42.22       ESTABLISHED
tcp4   22598      0  172.28.103.42.54737    172.28.103.42.8010     CLOSE_WAIT
tcp4       0      0  *.13                   *.*                    LISTEN
tcp        0      0  *.21                   *.*                    LISTEN
tcp4       0      0  *.22                   *.*                    LISTEN
tcp        0      0  *.23                   *.*                    LISTEN
tcp4       0      0  *.37                   *.*                    LISTEN
tcp4       0      0  172.28.103.42.389      172.28.103.42.62406    ESTABLISHED
tcp4       0      0  172.28.103.42.62406    172.28.103.42.389      ESTABLISHED


root (at) il01-lba401-fegi01:/#uname -a
AIX il01-lba401-fegi01 3 4 000C046D4C00
root (at) il01-lba401-fegi01:/#netstat -na | grep tcp | head
tcp4       0    112  10.174.184.1.22        10.174.187.4.58254     ESTABLISHED
tcp4       0      0  10.174.184.1.22        10.174.187.4.32834     ESTABLISHED
tcp4       0      0  213.174.160.26.53      *.*                    LISTEN
tcp4       0      0  213.174.160.25.53      *.*                    LISTEN
tcp4       0      0  213.174.160.24.53      *.*                    LISTEN
tcp4       0      0  213.174.160.23.53      *.*                    LISTEN
tcp4       0      0  213.174.160.22.53      *.*                    LISTEN
tcp4       0      0  213.174.160.21.53      *.*                    LISTEN
tcp4       0      0  213.174.160.20.53      *.*                    LISTEN
tcp4       0      0  127.0.0.1.53           *.*                    LISTEN