From owner-freebsd-questions@FreeBSD.ORG Mon Aug 3 12:48:44 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C61D1065670 for ; Mon, 3 Aug 2009 12:48:44 +0000 (UTC) (envelope-from vince@unsane.co.uk) Received: from unsane.co.uk (unsane-pt.tunnel.tserv5.lon1.ipv6.he.net [IPv6:2001:470:1f08:110::2]) by mx1.freebsd.org (Postfix) with ESMTP id 6D5988FC12 for ; Mon, 3 Aug 2009 12:48:43 +0000 (UTC) (envelope-from vince@unsane.co.uk) Received: from vhoffman.lon.namesco.net (207.112-84-212.staticip.namesco.net [212.84.112.207]) (authenticated bits=0) by unsane.co.uk (8.14.3/8.14.3) with ESMTP id n73CpgSA068520 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 3 Aug 2009 13:51:44 +0100 (BST) (envelope-from vince@unsane.co.uk) Message-ID: <4A76DCA2.6020204@unsane.co.uk> Date: Mon, 03 Aug 2009 13:48:34 +0100 From: Vincent Hoffman User-Agent: Thunderbird 2.0.0.22 (Macintosh/20090605) MIME-Version: 1.0 To: Anton References: <70C0964126D66F458E688618E1CD008A0793F2AB@WADPEXV0.waddell.com> <1815694960.20090803131340@sng.by> In-Reply-To: <1815694960.20090803131340@sng.by> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Gary Gatten , freebsd-questions@freebsd.org Subject: Re: Analyze load of the channel to Internet X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2009 12:48:44 -0000 Anton wrote: > Hello Gary, > > Due to what I've read about ntop - it is not really what I need. > > I dont have any Cisco routers, nor switches with port-mirroring - so I > c=uld not collect any traffic. I have only 2 freebsd routers - and > need to k=ow - when the outgoing channel of first gets overflowed > and I need to redi=ect outgoing traffic to second Freebsd comes with bsnmp or if you prefer ports try net-snmp from ports, these will let you query the snmp OID's mentioned. I use a little perl script to query them and graph them myself for my home router. If you dont like snmp for some reason, putting something together using netstat shouldnt be too hard. For example (12:45:12 <~>) 0 # netstat -b -f inet -I fxp1 Name Mtu Network Address Ipkts Ierrs Ibytes Opkts Oerrs Obytes Coll fxp1 1500 10.0.0.0/25 intgate 806889 - 118190683 1247743 - 1621177480 - (excuse word wrap but it shouldnt be too hard to work out) running this every minute from cron would make it easy to grab the in (Ibytes) or out (Obytes) traffc and perform actions accordingly. very quick and dirty example: -------------cut-------------------- #!/bin/sh IFNAME="fxp0" OLDIN=$(netstat -b -I $IFNAME | awk '/Link/{print $7}') OLDOUT=$(netstat -b -I $IFNAME | awk '/Link/{print $10}') sleep 10 NEWIN=$(netstat -b -I $IFNAME | awk '/Link/{print $7}') NEWOUT=$(netstat -b -I $IFNAME | awk '/Link/{print $10}') INBPS=$(echo "( $NEWIN - $OLDIN ) / 10 " | bc ) OUTBPS=$(echo "( $NEWOUT - $OLDOUT ) / 10 " | bc ) echo "$IFNAME is doing $INBPS bytes a second inbound" echo "$IFNAME is doing $OUTBPS bytes a second outbound" --------------cut---------------------------- sample output: (13:50:09 <~>) 0 # sh foo.sh fxp0 is doing 1247 bytes a second inbound fxp0 is doing 51175 bytes a second outbound Vince > > Monday, August 3, 2009, 4:55:00 AM, you wrote: > > > > > almost any NIC / OS will support SNMP MIB-II counter=, which > includes octets Tx and Rx. MANY tools available for "getting" snmp mib values. > > If you want util AND details on IP, ports, etc. - ch=ck out nTop.org > > ----- Original Message ----- > > From: owner-freebsd-questions@freebsd.org > > To: freebsd-questions@freebsd.org > > Sent: Sun Aug 02 15:08:38 2009 > > Subject: Analyze load of the channel to Internet > > Hello everybody... > > Need to view and get real-time reporting of outgoing=hannel to > Internet? > > I think, that this is may be realized by means of ip=w (e.g. - get > counters > > of count rules for Internet and divide them to time,=hich passed > between > > analyzing) > > But, maybe, there is an utility, to which I can comm=nicate (or > which could > > analyze) my outgoing channel to Internet - and repor= me (mean some > > redirection script) when an outgoing channel gets ov=rflowed, and I > need to > > redirect all other outgoing traffic to another chann=l. > > I would like to clear: I have to channels for Intern=t, meaned for > gaming > > club - but I don't have enough finance to afford buy=ng some Cisco > device > > and this 2 channel are 512 kilobits and 768 kilobits=f outgoing > traffic > > Please, help > > _______________________________________________ > > freebsd-questions@freebsd.org mailing list > > [1]http://lists.freebsd.org/mailman/listinfo/freebsd-questions > > To unsubscribe, send any mail to "freebsd-questions- unsubscribe@freebsd.org" > > "This email is intended to be reviewed by only the i=tended > recipient and may contain information that is privileged and/or con fidential. If you are not the intended recipient, you are hereby > notified t=at any review, use, dissemination, disclosure or copying > of this email and=ts attachments, if any, is strictly prohibited. If > you have received this=mail in error, please immediately notify the > sender by return email and d=lete this email from your system." > > -- > > Best regards, > > Anton &nbs=; [2]mailto:anton@sng.by > > Administrator > > Feel free to contact me > > via ICQ 363780596 > > via Skype dobryak47 > > via phone +375 29 3320987 > > References > > 1. 3D"http://lists.freebsd.org/mailman/listinfo/freeb 2. 3D"mailto:anton@sng.by" > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"