Date: Mon, 03 Aug 2009 13:48:34 +0100 From: Vincent Hoffman <vince@unsane.co.uk> To: Anton <anton@sng.by> Cc: Gary Gatten <Ggatten@waddell.com>, freebsd-questions@freebsd.org Subject: Re: Analyze load of the channel to Internet Message-ID: <4A76DCA2.6020204@unsane.co.uk> In-Reply-To: <1815694960.20090803131340@sng.by> References: <70C0964126D66F458E688618E1CD008A0793F2AB@WADPEXV0.waddell.com> <1815694960.20090803131340@sng.by>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <owner- freebsd-questions@freebsd.org> > > To: freebsd-questions@freebsd.org <freebsd-questi=ns@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"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4A76DCA2.6020204>