From owner-freebsd-questions Thu May 16 13:36:29 2002 Delivered-To: freebsd-questions@freebsd.org Received: from chivas.oneill.dhs.org (chivas.oneill.dhs.org [65.65.85.161]) by hub.freebsd.org (Postfix) with ESMTP id 7934237B400 for ; Thu, 16 May 2002 13:36:23 -0700 (PDT) Received: from v812r.seanoneill.info (dhcp1.NONROUTABLE [192.168.2.1]) by chivas.oneill.dhs.org (Postfix) with ESMTP id E8263767D; Thu, 16 May 2002 15:36:18 -0500 (CDT) Message-Id: <5.1.0.14.0.20020516153114.00b17e90@postoffice.swbell.net> X-Sender: swoneill@postoffice.swbell.net X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Thu, 16 May 2002 15:36:17 -0500 To: Patrick Thomas From: Sean O'Neill Subject: Re: per IP traffic statistics (totals) Cc: freebsd-questions@freebsd.org In-Reply-To: <20020516131649.C79837-100000@utility.clubscholarship.com> References: <20020516214027.L58681-100000@lion.com.ua> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed 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 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