DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 29th November 2009
mikesg's Avatar
mikesg mikesg is offline
I can has a title?
 
Join Date: Aug 2009
Posts: 28
Default total traffic per day/wk/mo/yr reports

I have a client which just entered an agreement with a small local cable internet provider which has a monthly usage cap. I would like to set up something on the firewall (OBSD 4.6) that I can log into via SSH and run a command to show me the current usage report for the day/wk/mo/yr. The ISP sends out warning emails when the quota is getting close, so I don't need a warning system. Just the report to confirm the ISP's numbers and to be able to check on our own. Long ago I used ipa, but would like to know if there is some new snazzy solution here.
__________________
Mike
Reply With Quote
  #2   (View Single Post)  
Old 30th November 2009
arch arch is offline
Port Guard
 
Join Date: Jun 2008
Posts: 38
Default

you can try mrtg
__________________
Verbose mode can also be turned on for SSH2 with the (surprise!) VerboseMode keyword.
Reply With Quote
  #3   (View Single Post)  
Old 30th November 2009
mikesg's Avatar
mikesg mikesg is offline
I can has a title?
 
Join Date: Aug 2009
Posts: 28
Default

I already use that. I'm not looking for averages. I'm looking for actual bytes transfered.
__________________
Mike
Reply With Quote
  #4   (View Single Post)  
Old 30th November 2009
rbelk rbelk is offline
New User
 
Join Date: Feb 2009
Posts: 1
Default

Check out vnStat. I can't post the URL because I have not posted 5 times to the Forum. I have used it on Linux and FreeBSD and it works with no issues.

Here's the output
Code:
rbelk@rbvmwk:~$ vnstat --help
 vnStat 1.9 by Teemu Toivola <tst at iki dot fi>

         -q,  --query          query database
         -h,  --hours          show hours
         -d,  --days           show days
         -m,  --months         show months
         -w,  --weeks          show weeks
         -t,  --top10          show top10
         -s,  --short          use short output
         -u,  --update         update database
         -i,  --iface          select interface (default: eth0)
         -?,  --help           short help
         -v,  --version        show version
         -tr, --traffic        calculate traffic
         -ru, --rateunit       swap configured rate unit
         -l,  --live           show transfer rate in real time

rbelk@rbvmwk:~$ vnstat
Database updated: Mon Nov 30 11:55:02 2009

   em0 since 10/04/09

          rx:  32.37 GiB      tx:  84.11 GiB      total:  116.49 GiB

   monthly
                     rx      |     tx      |    total    |   avg. rate
     ------------------------+-------------+-------------+---------------
       Oct '09     17.21 GiB |   34.81 GiB |   52.02 GiB |  162.92 kbit/s
       Nov '09     15.17 GiB |   49.30 GiB |   64.47 GiB |  211.91 kbit/s
     ------------------------+-------------+-------------+---------------
     estimated     15.40 GiB |   50.07 GiB |   65.48 GiB |

   daily
                     rx      |     tx      |    total    |   avg. rate
     ------------------------+-------------+-------------+---------------
     yesterday    128.09 MiB |    1.25 GiB |    1.38 GiB |  133.91 kbit/s
         today     69.58 MiB |  404.34 MiB |  473.91 MiB |   90.49 kbit/s
     ------------------------+-------------+-------------+---------------
     estimated       138 MiB |     813 MiB |     951 MiB |
Reply With Quote
  #5   (View Single Post)  
Old 30th November 2009
denta denta is offline
Shell Scout
 
Join Date: Nov 2009
Location: Sweden
Posts: 95
Default

Or maybe to check netflows with pflow (4) and nfcapd/nfdump could be an idea? Its quite easy to setup and really powerful/awesome!
Reply With Quote
  #6   (View Single Post)  
Old 30th November 2009
ephemera's Avatar
ephemera ephemera is offline
Knuth's homeboy
 
Join Date: Apr 2008
Posts: 537
Default

I had written something like vnstat in the past. The rx/tx bytes from the NIC usually doesn't correspond well with the download figure the ISP is charging you for.
Reply With Quote
  #7   (View Single Post)  
Old 1st December 2009
roundkat roundkat is offline
Shell Scout
 
Join Date: May 2008
Posts: 115
Default

Quote:
Originally Posted by rbelk View Post
Check out vnStat. I can't post the URL because I have not posted 5 times to the Forum. I have used it on Linux and FreeBSD and it works with no issues.
Working on the OpenBSD install now..

rk
__________________
All posts sent on ReCycled Electrons...
Reply With Quote
  #8   (View Single Post)  
Old 4th December 2009
mikesg's Avatar
mikesg mikesg is offline
I can has a title?
 
Join Date: Aug 2009
Posts: 28
Default

Quote:
Originally Posted by ephemera View Post
I had written something like vnstat in the past. The rx/tx bytes from the NIC usually doesn't correspond well with the download figure the ISP is charging you for.
And this would be because why? It would be kind of self-defeating if it's not accurate.
__________________
Mike
Reply With Quote
  #9   (View Single Post)  
Old 21st October 2010
mikesg's Avatar
mikesg mikesg is offline
I can has a title?
 
Join Date: Aug 2009
Posts: 28
Default

When I try to build (make all) vnstat, I get this:
Code:
# make all
gcc -O2  -c vnstat.c
gcc -O2  -c ifinfo.c
gcc -O2  -c dbxml.c
gcc -O2  -c dbshow.c
gcc -O2  -c dbaccess.c
gcc -O2  -c dbmerge.c
gcc -O2  -c common.c
gcc -O2  -c misc.c
gcc -O2  -c cfg.c
gcc -O2  -c traffic.c
gcc  vnstat.o ifinfo.o dbxml.o dbshow.o dbaccess.o dbmerge.o common.o misc.o cfg.o traffic.o -lm -o vnstat
ifinfo.o(.text+0x157): In function `getiflist':
: warning: strcat() is almost always misused, please use strlcat()
gcc -O2  -c vnstatd.c
gcc -O2  -c dbcache.c
gcc  vnstatd.o ifinfo.o dbaccess.o dbcache.o common.o misc.o cfg.o -lm -o vnstatd
ifinfo.o(.text+0x157): In function `getiflist':
: warning: strcat() is almost always misused, please use strlcat()
gcc -O2  -c vnstati.c
gcc -O2  -c image.c
gcc  vnstati.o image.o dbaccess.o dbmerge.o common.o misc.o cfg.o -lm -lgd -o vnstati
/usr/bin/ld: cannot find -lgd
collect2: ld returned 1 exit status
*** Error code 1

Stop in /home/stuff/vnstat-1.10/src (line 17 of Makefile).
Not good at diagnosing build problems. It appears the issue is with the -igd parameter.
__________________
Mike
Reply With Quote
Old 21st October 2010
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by mikesg View Post
It appears the issue is with the -igd parameter.
The parameter is -lgd which means "include the gd library when linking". Most likely, the library was not found on the path understood by the linker.
Reply With Quote
Old 21st October 2010
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

Pretty obvious error message, it can't link with the gd library.. it's a library used for generating images.

This is a dependency problem, install the package.
$ sudo pkg_add gd

EDIT: ocicat beat me to it.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
JPEG library reports unrecoverable error: Calderon FreeBSD General 2 26th August 2009 03:07 PM
Total Success divadgnol67 OpenBSD General 0 6th August 2009 07:15 PM
Uname still reports 7.0 release maxrussell FreeBSD Installation and Upgrading 6 4th May 2009 12:49 PM
fsck reports errors but does not fix them. map7 FreeBSD General 13 2nd December 2008 10:45 PM
Interface - total bandwidth centerstage OpenBSD General 11 18th June 2008 11:20 PM


All times are GMT. The time now is 08:00 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick