On Wed, Sep 17, 2008 at 09:06:04PM +0000, Stuart Henderson wrote:
> On 2008-09-17, Joe S <[EMAIL PROTECTED]> wrote:
> > Now that my ISP is imposing bandwidth caps, I need to start measuring
> > my usage. Graphs are nice, but I've found that graphs are not really
> > that useful to me. I need something to report what my cummalative
> > usage is in a 30 day period. I'd like the data in some sort of ascii
> > format, but html is ok too.
> 
> You can't get much simpler than logging "netstat -I<iface> -b"...
>  
> > After googling for a little bit, I only found 2 apps that might work
> > on my OpenBSD 4.3-stable firewall, vmnet and rtg. There is port or
> > package available for either though. The output of "vmnet -m" is what
> > I'm looking for, so I'll try that first. I was happy to see that rtg
> > is now in current-ports, so I should be able to use it once I get my
> > preordered CDs.
> 
> rtg is nice for ISP billing because it keeps all the data it fetches,
> this means you can account for bandwidth use in all sorts of ways
> (not least, accurate 95-percentile) and change the way you process
> them after the initial configuration (not possible with RRD which
> decimates old data). But it's a bit of a faff to setup, and not all
> that lightweight...
 
I'm being a tease again:


nfdb=# SELECT sum(flow_packets) AS packets, sum(flow_octets) AS bytes,
dst_addr AS server 
FROM flows_current where dst_addr <<= '66.205.209.0/24' 
AND protocol=6 
AND "timestamp" > now() - interval '1 week' 
GROUP BY dst_addr 
ORDER BY bytes DESC LIMIT 10;

 packets |   bytes    |     server     
---------+------------+----------------
 9149276 | 6102457003 | 66.205.209.31
 5439809 | 5614875206 | 66.205.209.15
 5760540 | 3762630650 | 66.205.209.16
  461723 |  297503707 | 66.205.209.12
  268520 |  154822480 | 66.205.209.14
  102066 |   65937949 | 66.205.209.58
   71905 |   64167244 | 66.205.209.252
  949452 |   58012301 | 66.205.209.60
   65539 |   45630979 | 66.205.209.105
   60786 |   42647988 | 66.205.209.106
(10 rows)


-- 
Jason Dixon
DixonGroup Consulting
http://www.dixongroup.net/

Reply via email to