From owner-freebsd-questions Thu May 16 13:46:40 2002 Delivered-To: freebsd-questions@freebsd.org Received: from utility.clubscholarship.com (utility.clubscholarship.com [198.78.70.175]) by hub.freebsd.org (Postfix) with ESMTP id 2080B37B40A for ; Thu, 16 May 2002 13:46:34 -0700 (PDT) Received: from localhost (root@localhost) by utility.clubscholarship.com (8.11.6/8.11.6) with ESMTP id g4GKgLd16341; Thu, 16 May 2002 13:42:21 -0700 (PDT) (envelope-from root@utility.clubscholarship.com) Date: Thu, 16 May 2002 13:42:21 -0700 (PDT) From: Patrick Thomas To: "Sean O'Neill" Cc: Subject: Re: per IP traffic statistics (totals) In-Reply-To: <5.1.0.14.0.20020516153114.00b17e90@postoffice.swbell.net> Message-ID: <20020516134047.N79837-100000@utility.clubscholarship.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG yes, that is not so hard - but what of turning that into nice bar graphs ? I need something visual to complement MRTG.... so i am willing to look at something other than `ipa`, but i still need to be able to count different IPs on the same NIC... On Thu, 16 May 2002, Sean O'Neill wrote: > At 01:17 PM 5/16/2002 -0700, Patrick Thomas wrote: > > >Do you know of any tools (like ipa) that will collect per-IP traffic > >totals and allow me to display on the web ? I am not a cgi programmer.. > > > >thanks. > > It really not that hard - at a simple level its pathetically easy. > > Create a script that displays your stats. I have one to display stats for > IPFilter on my Solaris box. Make sure CGIs are enabled in your apache > config, stick the script in your apache cgi-bin directory (or where ever > CGI's are enabled for you), make the script executable, and hit the cgi-bin > URL for the script. > > This is my script. See - its easy. > > #!/bin/ksh > > # disable filename globbing > set -f > > echo Content-type: text/plain > echo > > IPFLOG=/var/adm/ipflog > > echo "BLOCK" > echo "-----" > grep "$(date "+%b %e")" ${IPFLOG} | grep -v qpopper | /usr/local/bin/perl > /opt/ipf/bin/plog -nAF block > echo "PASS" > echo "----" > grep "$(date "+%b %e")" ${IPFLOG} | grep -v qpopper | /usr/local/bin/perl > /opt/ipf/bin/plog -nAF pass > echo "LOG" > echo "---" > grep "$(date "+%b %e")" ${IPFLOG} | grep -v qpopper | /usr/local/bin/perl > /opt/ipf/bin/plog -nAF log > echo "SHORT" > echo "-----" > grep "$(date "+%b %e")" ${IPFLOG} | grep -v qpopper | /usr/local/bin/perl > /opt/ipf/bin/plog -nAF short > echo "NOMATCH" > echo "-------" > grep "$(date "+%b %e")" ${IPFLOG} | grep -v qpopper | /usr/local/bin/perl > /opt/ipf/bin/plog -nAF nomatch > > You want fancy HTML formatting around your output - have at it. Simple to > update this script to include HTML formatting for tables, frames, whatever. > > > -- > ........................................................ > ......... ..- -. .. -..- .-. ..- .-.. . ... ............ > .-- .. -. -... .-.. --- .-- ... -.. .-. --- --- .-.. ... > > Sean O'Neill > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message