From owner-freebsd-net Sat Dec 18 15:18:56 1999 Delivered-To: freebsd-net@freebsd.org Received: from expert.com.br (atalaia.expert.com.br [200.242.253.1]) by hub.freebsd.org (Postfix) with SMTP id BB4F61500D for ; Sat, 18 Dec 1999 15:18:50 -0800 (PST) (envelope-from aldrin@americasnet.com) Received: (qmail 86842 invoked from network); 18 Dec 1999 23:18:45 -0000 Received: from bxs20-1-p24.expert.com.br (HELO sixty.expert.com.br) (aldrin@200.242.253.164) by soure.expert.com.br with SMTP; 18 Dec 1999 23:18:45 -0000 Message-ID: <007101bf49a8$5eeeb9a0$0200a8c0@expert.com.br> From: "Aldrin Leal" To: "Ian Smith" Cc: References: Subject: Re: Math Help for IPFW :) Date: Sat, 18 Dec 1999 20:36:42 -0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > Sure you can use SNMP also, or instead, but if you want to do it from I really haven't tried to find SMNP agents for Win9x, which are the platform for the computers. > your gathered IPFW data, why not just use the byte counters rather than > or as well as the packet counters, per rule? How to look at the byte counters? :] My source is: ### Cut here #!/usr/bin/suidperl $rule = 2500; if (open(HANDLE, "/sbin/ipfw -q show $rule|")) { if ($line = ) { chomp $line; @values = split(' ', $line); $packets = $values[2]; } close(HANDLE); } system "/sbin/ipfw -q zero $rule"; print "$packets\n$packets\n00:00\nrule $rule\n"; ### Unclip The rule is: 02500 108 11320 allow ip from 200.242.253.6 to any > > The first problem is that packet size varies greatly -- it could be a > > single byte (plus header/address information), or quite large, depending > > on what the interface type/parameters are set for. That's where all my problem starts... and ends. > > The best solution I found for this is SNMP, which is what most of the "big > > boys" (PSI Net, for example) use. I do something similar -- sample the > > "interfaces.ifTable.ifEntry.ifOutOctets" and > > "interfaces.ifTable.ifEntry.ifInOctets" entries for each interface > > periodically, and you can calculate the average bandwidth usage per > > interface pretty easily: Well. I'll try to find an SNMP agent. thanks, anyway. :) done, Aldrin Leal mailto:aldrin@americasnet.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message