[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Controlling IP traffic (e.g. per month)



On Mon, 2002-10-28 at 10:32, Dieter Heiliger wrote:

> I am doing the administration for a server located at an ISP. We have a 
> certain amount of traffic per month included in the monthly fee. 
> Additional traffic will be paid extra.
> 
> Now I want to get more control over the traffic that was already used 
> since the beginning of each month. My ideal configuration would be to 
> get an email when e.g. 80% of the traffic included in the monthly fee 
> got used already. When a new month begins the counter has to be set to 
> zero again.
> 
> Is there an easy way to implement this?

ipac (if you use ipchains) or ipac-ng (if using iptables).

Then you can use the ipacsum command to generate a report. If you are
only interested in the total traffic you could use something like:

root@spiderwebs:~#ipacsum -t "this month" --filter "all" --fixed-quantity ''
IP accounting summary
Host: spiderwebs / Time created: 2002/10/28 11:10:42 CE
Data from 2002/10/01 01:00:00 CE to 2002/10/28 11:10:42 CE
  total in all                                    :      4317454231
  total out all                                   :      4328291196

With a bit of perl or awk it's not difficult to calculate whether this
is below or above your 80% threshold and decide if an email should be
sent.

-- 
Tot ziens,
Bart-Jan Vrielink



Reply to: