ascii bandwidth report

2008-09-17 Thread Joe S
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. I think I need something that can poll
snmp stats from fxp0, which is attached to my cable modem. Something
small would be preferred. I'm not interested in cacti or other large
installations. My needs are very modest...I hope.

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.

If you have any suggestions, or you have a perl/python script that you
would like to share, it would be appreciated.



Re: ascii bandwidth report

2008-09-17 Thread Christophe Rioux
Hi

I use cacti to monitor my routers, servers and firewalls. I also build the
associated report (templates) thanks to
http://www.packetmischief.ca/openbsd/snmp/): interfaces and temperature.

You can install cacti under Windows or under Linux. May be this can also
work on OpenBsd (never test it)

Regards

 -Message d'origine-
 De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 De la part de Joe S
 Envoyi : mercredi 17 septembre 2008 17:20
 @ : misc@openbsd.org
 Objet : ascii bandwidth report

 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. I think I need something that can poll
 snmp stats from fxp0, which is attached to my cable modem. Something
 small would be preferred. I'm not interested in cacti or other large
 installations. My needs are very modest...I hope.

 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.

 If you have any suggestions, or you have a perl/python script that you
 would like to share, it would be appreciated.



Re: ascii bandwidth report

2008-09-17 Thread Juan Miscaro
2008/9/17 Joe S [EMAIL PROTECTED]:
 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. I think I need something that can poll
 snmp stats from fxp0, which is attached to my cable modem. Something
 small would be preferred. I'm not interested in cacti or other large
 installations. My needs are very modest...I hope.

 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.

 If you have any suggestions, or you have a perl/python script that you
 would like to share, it would be appreciated.



Yes, I have a shell script that does this.  It gives usage breakdown
by network protocol and outputs this in an HTML table.  It is based on
pf rule labels and pfctl output.  I'll post it here when I find it.

/juan



Re: ascii bandwidth report

2008-09-17 Thread Pedro de Oliveira
Also check this: http://humdi.net/vnstat/ i dont know if its currently
working on openbsd, but theres some patches, making it work shoulnt be
difficult, and this surely is what youre looking for, heres what the output
looks like:

Database updated: Wed Sep 17 16:57:02 2008

eth0

   received:5813558 MB (87.5%)
transmitted: 834246 MB (12.5%)
  total:6647805 MB

rx | tx |  total
---++---
yesterday 26487 MB |1478 MB |   27965 MB
today 22870 MB |1007 MB |   23878 MB
---++---
estimated 32382 MB |1425 MB |   33807 MB 

-Mensagem original-
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Em nome de Joe S
Enviada: quarta-feira, 17 de Setembro de 2008 16:20
Para: misc@openbsd.org
Assunto: ascii bandwidth report

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. I think I need something that can poll snmp stats from fxp0, which
is attached to my cable modem. Something small would be preferred. I'm not
interested in cacti or other large installations. My needs are very
modest...I hope.

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.

If you have any suggestions, or you have a perl/python script that you would
like to share, it would be appreciated.



Re: ascii bandwidth report

2008-09-17 Thread Joe S
Thanks for the comment. However I'm not looking for a graphing
solution like cacti, although there is a report plugin for cacti.
Cacti seems overkill. I did setup have some simple temperature and io
graphs, courtesy of symon.


On Wed, Sep 17, 2008 at 8:44 AM, Christophe Rioux [EMAIL PROTECTED] wrote:
 Hi

 I use cacti to monitor my routers, servers and firewalls. I also build the
 associated report (templates) thanks to
 http://www.packetmischief.ca/openbsd/snmp/): interfaces and temperature.

 You can install cacti under Windows or under Linux. May be this can also
 work on OpenBsd (never test it)

 Regards

 -Message d'origine-
 De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 De la part de Joe S
 Envoyi : mercredi 17 septembre 2008 17:20
 @ : misc@openbsd.org
 Objet : ascii bandwidth report

 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. I think I need something that can poll
 snmp stats from fxp0, which is attached to my cable modem. Something
 small would be preferred. I'm not interested in cacti or other large
 installations. My needs are very modest...I hope.

 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.

 If you have any suggestions, or you have a perl/python script that you
 would like to share, it would be appreciated.



Re: ascii bandwidth report

2008-09-17 Thread Juan Miscaro
2008/9/17 Joe S [EMAIL PROTECTED]:
 Thanks for the comment. However I'm not looking for a graphing
 solution like cacti, although there is a report plugin for cacti.
 Cacti seems overkill. I did setup have some simple temperature and io
 graphs, courtesy of symon.


 On Wed, Sep 17, 2008 at 8:44 AM, Christophe Rioux [EMAIL PROTECTED] wrote:
 Hi

 I use cacti to monitor my routers, servers and firewalls. I also build the
 associated report (templates) thanks to
 http://www.packetmischief.ca/openbsd/snmp/): interfaces and temperature.

 You can install cacti under Windows or under Linux. May be this can also
 work on OpenBsd (never test it)

 Regards

 -Message d'origine-
 De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 De la part de Joe S
 Envoyi : mercredi 17 septembre 2008 17:20
 @ : misc@openbsd.org
 Objet : ascii bandwidth report

 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. I think I need something that can poll
 snmp stats from fxp0, which is attached to my cable modem. Something
 small would be preferred. I'm not interested in cacti or other large
 installations. My needs are very modest...I hope.

 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.

 If you have any suggestions, or you have a perl/python script that you
 would like to share, it would be appreciated.

Here you go!  Comments and improvements welcome.

/juan

[demime 1.01d removed an attachment of type application/x-sh which had a name 
of ipaccnt.sh]



Re: ascii bandwidth report

2008-09-17 Thread Stuart Henderson
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 -Iiface -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...



Re: ascii bandwidth report

2008-09-17 Thread Jason Dixon
On Wed, Sep 17, 2008 at 09:06:04PM +, 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 -Iiface -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/