[Zope-dev] TCPWatch How-To

Shane Hathaway shane@digicool.com
Wed, 06 Sep 2000 10:16:39 -0400


Chris Withers wrote:
> 
> Shane Hathaway wrote:
> > TCPWatch is a simple Python script that lets you monitor a TCP
> > connection.
> 
> ...now this really is extremely useful to me, but not for Zope ;-)
> 
> However, it did take me a while to wrap my head around it. So here's a
> little How-To/Example (If anyone thinks I should do this as a How-To on
> Zope.org, just let me know...)
> 
> 1. Run up Zope on you local machine on port 8080
> 2. Set the following off in an appropriate shell:
> 
> python tcpwatch.py 9080 localhost 8080

I thought about writing a server-starter GUI so that command line
wouldn't even be necessary.  But I decided I like TCPWatch how it is
already.  It's simple and to the point.

> 3. Point a browser at localhost:9080
> 
> Now, the tkinter window that pops up will show you a list of TCP
> connections that happen and when they started.
> If you click on them you get shown all the data which was sent to the
> server (preceded by '==>') and to the client (preceded by '<==') as well
> as the times the connections opened and closed (could be very useful for
> spotting connections that Zope, or anything else, leaves open longer
> than it should)
> 
> This is a very cool little tool :-)

It should work with most TCP protocols including smtp, imap, pop-3,
ssh, ZEO, and even that new multi-stream protocol announced recently. 
It might have troubles with ftp, however.

BTW it uses decimal rather than octal to encode control characters,
which doesn't follow the "standard" but rather my own preference. :-) 
It should probably be a command-line option.

Shane