Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Sep 1998 18:32:46 +0300
From:      "Eugene Shvetc" <eugene@shvetc.zp.ua>
To:        <freebsd-questions@FreeBSD.ORG>, <freebsd-isp@FreeBSD.ORG>, <freebsd-hackers@FreeBSD.ORG>
Subject:   Re: traffic counter
Message-ID:  <003d01bdea2c$15af1be0$badbc1c1@wints.shvetc.zp.ua>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.

------=_NextPart_000_0036_01BDEA45.38BA0500
Content-Type: text/plain;
	charset="koi8-r"
Content-Transfer-Encoding: 7bit

Thanks you all, but i need to count via snmp, or 
from mrtg log files. 

------=_NextPart_000_0036_01BDEA45.38BA0500
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Description: Re: traffic counter
Content-Disposition: attachment

Return-Path: jkb@best.com
Received: from shell6.ba.best.com (jkb@shell6.ba.best.com [206.184.139.137])
	by home.shvetc.zp.ua (8.9.1a/8.9.1) with ESMTP id WAA12328
	for <eugene@shvetc.zp.ua>; Sat, 26 Sep 1998 22:14:14 +0300 (EEST)
Received: from localhost (jkb@localhost)
	by shell6.ba.best.com (8.9.0/8.9.0/best.sh) with SMTP id MAA09204
	for <eugene@shvetc.zp.ua>; Sat, 26 Sep 1998 12:14:03 -0700 (PDT)
X-Authentication-Warning: shell6.ba.best.com: jkb owned process doing -bs
Date: Sat, 26 Sep 1998 12:14:02 -0700 (PDT)
From: "Jan B. Koum " <jkb@best.com>
X-Sender: jkb@shell6.ba.best.com
To: Eugene Shvetc <eugene@shvetc.zp.ua>
Subject: Re: traffic counter
In-Reply-To: <000101bde96a$67356680$badbc1c1@wints.shvetc.zp.ua>
Message-ID: <Pine.BSF.4.02A.9809261213560.7756-100000@shell6.ba.best.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-UIDL: e8dad7108778c90c365b0e3b3d0529cc


	man ipfw

-- Yan

I don't have the password .... + Jan Koum 
But the path is chainlinked .. | Spelled Jan, pronounced Yan. There. 
So if you've got the time .... | Web: http://www.best.com/~jkb
Set the tone to sync ......... + OS: http://www.FreeBSD.org

On Sat, 26 Sep 1998, Eugene Shvetc wrote:

>
>    Hi!
>
>There is a task: to write programm, which daily counts up
>amount byte, transferred through interface. It is necessary,
>what it took information from mrtg log files, or itself took
>statistics using snmp. Nobody was engaged in such? And that
>completely is no time to write itself :-(
>
>Beforehand is grateful.
>
>---
>Eugene Shvetc
>MARKA ISP
>eugene@shvetc.zp.ua
>Tel, fax: +380 612 120186
>
>
>To Unsubscribe: send mail to majordomo@FreeBSD.org
>with "unsubscribe freebsd-isp" in the body of the message
>


------=_NextPart_000_0036_01BDEA45.38BA0500
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Description: Re: traffic counter
Content-Disposition: attachment

Return-Path: andrew@squiz.co.nz
Received: from aniwa.sky (pppk-02.igrin.co.nz [202.49.245.81])
	by home.shvetc.zp.ua (8.9.1a/8.9.1) with ESMTP id AAA13684
	for <eugene@shvetc.zp.ua>; Sun, 27 Sep 1998 00:51:20 +0300 (EEST)
Received: from localhost (andrew@localhost)
	by aniwa.sky (8.8.8/8.8.7) with SMTP id JAA00447
	for <eugene@shvetc.zp.ua>; Sun, 27 Sep 1998 09:50:23 +1200 (NZST)
	(envelope-from andrew@squiz.co.nz)
Date: Sun, 27 Sep 1998 09:49:01 +1200 (NZST)
From: Andrew McNaughton <andrew@squiz.co.nz>
X-Sender: andrew@aniwa.sky
Reply-To: andrew@squiz.co.nz
To: Eugene Shvetc <eugene@shvetc.zp.ua>
Subject: Re: traffic counter
In-Reply-To: <000101bde96a$67356680$badbc1c1@wints.shvetc.zp.ua>
Message-ID: <Pine.BSF.3.96.980927094813.390A-100000@aniwa.sky>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-UIDL: eb7c552242f196bbfc55fb56f0e2a046

On Sat, 26 Sep 1998, Eugene Shvetc wrote:

> Date: Sat, 26 Sep 1998 19:26:21 +0300
> From: Eugene Shvetc <eugene@shvetc.zp.ua>
> To: freebsd-questions@FreeBSD.ORG
> Cc: freebsd-hackers@FreeBSD.ORG, freebsd-isp@FreeBSD.ORG
> Subject: traffic counter
> 
> 
>     Hi!
> 
> There is a task: to write programm, which daily counts up
> amount byte, transferred through interface. It is necessary,
> what it took information from mrtg log files, or itself took
> statistics using snmp. Nobody was engaged in such? And that
> completely is no time to write itself :-(
> 
> Beforehand is grateful.

use netstat or ipfw



------=_NextPart_000_0036_01BDEA45.38BA0500
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Description: Re: traffic counter
Content-Disposition: attachment

Return-Path: dchapes@ddm.on.ca
Received: from ymris.ddm.on.ca (p17a.neon.sentex.ca [207.245.212.210])
	by home.shvetc.zp.ua (8.9.1a/8.9.1) with ESMTP id RAA22174
	for <eugene@shvetc.zp.ua>; Sun, 27 Sep 1998 17:32:10 +0300 (EEST)
Received: from squigy.ddm.on.ca (squigy.ddm.on.ca [209.112.59.10])
	by ymris.ddm.on.ca (8.8.8/8.8.8) with ESMTP id KAA12856
	for <eugene@shvetc.zp.ua>; Sun, 27 Sep 1998 10:31:08 -0400 (EDT)
	(envelope-from dchapes@ymris.ddm.on.ca)
From: Dave Chapeskie <dchapes@ddm.on.ca>
Received: (from dchapes@localhost)
	by squigy.ddm.on.ca (8.8.8/8.8.7) id KAA01287;
	Sun, 27 Sep 1998 10:31:06 -0400 (EDT)
Message-ID: <19980927103106.04062@ddm.on.ca>
Date: Sun, 27 Sep 1998 10:31:06 -0400
To: Eugene Shvetc <eugene@shvetc.zp.ua>
Subject: Re: traffic counter
References: <000101bde96a$67356680$badbc1c1@wints.shvetc.zp.ua>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Mailer: Mutt 0.89i
In-Reply-To: <000101bde96a$67356680$badbc1c1@wints.shvetc.zp.ua>; from Eugene Shvetc on Sat, Sep 26, 1998 at 07:26:21PM +0300
Return-Receipt-To: dchapes@ddm.on.ca
X-UIDL: 8873d7d900322989cc2306acf5838e13

On Sat, Sep 26, 1998 at 07:26:21PM +0300, Eugene Shvetc wrote:
> There is a task: to write programm, which daily counts up
> amount byte, transferred through interface. It is necessary,
> what it took information from mrtg log files, or itself took
> statistics using snmp. Nobody was engaged in such? And that
> completely is no time to write itself :-(
> 
> Beforehand is grateful.

You need to learn how to write scripts, this isn't a question
for hacker-freebsd-hackers.  Just run something like this from
/etc/daily.local.  If you wanted to get fancy you could have a perl
script that extracted the 'Ibytes' and 'Obytes' fields and subtracted
yesturday's values from today's (if /kern/bootime says we haven't been
rebooted since the timestamp on yesturday's values).


#!/bin/sh
if [ -f /var/log/netstat.today ]; then
	mv -f /var/log/netstat.today /var/log/netstat.yesturday
fi
netstat -ib > /var/log/netstat.today
diff -uN /var/log/netstat.{yesturday,today}

-- 
Dave Chapeskie, DDM Consulting <dchapes@ddm.on.ca>

------=_NextPart_000_0036_01BDEA45.38BA0500
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Description: Re: traffic counter
Content-Disposition: attachment

Return-Path: justin@mascarpone.coventry.ac.uk
Received: from coventry.ac.uk (mercury.coventry.ac.uk [193.61.107.16])
	by home.shvetc.zp.ua (8.9.1a/8.9.1) with ESMTP id SAA22532
	for <eugene@shvetc.zp.ua>; Sun, 27 Sep 1998 18:13:45 +0300 (EEST)
Received: from mascarpone.coventry.ac.uk (mascarpone.coventry.ac.uk [194.66.38.77]) by coventry.ac.uk (8.8.7/8.6.11) with SMTP id QAA08548 for <@mercury.coventry.ac.uk:eugene@shvetc.zp.ua>; Sun, 27 Sep 1998 16:13:34 +0100 (BST)
Received: (from justin@localhost) by mascarpone.coventry.ac.uk (950413.SGI.8.6.12/950213.SGI.AUTOCF) id QAA01161; Sun, 27 Sep 1998 16:13:07 +0100
Message-Id: <199809271513.QAA01161@mascarpone.coventry.ac.uk>
Date: Sun, 27 Sep 98 16:13 +0100
From: Justin Murdock <justin@vide.coventry.ac.uk>
Subject: Re: traffic counter
To: "Eugene Shvetc" <eugene@shvetc.zp.ua>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
In-Reply-To: Eugene Shvetc's mail of Sat, 26 Sep 98 19:26 +0300
X-Mailer: Af v1.98.4
X-UIDL: d2a15b313f5fdf164bfd2e6d36172a1d

>     Hi!
> 
> There is a task: to write programm, which daily counts up
> amount byte, transferred through interface. It is necessary,
> what it took information from mrtg log files, or itself took
> statistics using snmp. Nobody was engaged in such? And that
> completely is no time to write itself :-(

> Beforehand is grateful.


netstat -w 86400

might do what you want.

------=_NextPart_000_0036_01BDEA45.38BA0500--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?003d01bdea2c$15af1be0$badbc1c1>