Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 May 2002 13:42:21 -0700 (PDT)
From:      Patrick Thomas <root@utility.clubscholarship.com>
To:        "Sean O'Neill" <sean@seanoneill.info>
Cc:        <freebsd-questions@freebsd.org>
Subject:   Re: per IP traffic statistics (totals)
Message-ID:  <20020516134047.N79837-100000@utility.clubscholarship.com>
In-Reply-To: <5.1.0.14.0.20020516153114.00b17e90@postoffice.swbell.net>

next in thread | previous in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020516134047.N79837-100000>