#!/bin/sh /usr/bin/netstat -an | awk ' # # this little awk acript will take the output of a netstat -an command # and turn it into a histogram of the number of TCP sockets in various # states. the original author is Rick Jones . Feel free # to make use of this under the terms of the copyright present in the # netperf benchmark as found on ftp.cup.hp.com. # # rick jones # BEGIN { total_sockets = 0; maximum = 0; printnum = 0; } function max(hist) { for (foo in hist) if (hist[foo] > maximum) maximum = hist[foo]; return maximum; } function print_bar(hashes, maximum) { if (maximum <= 60) { for(j=0;j