Re: Traffic accounten

From: Oliver Lehmann <lehmann(at)ans-netz.de>
Date: Tue, 4 Mar 2003 05:12:31 +0100

Nicola Tiling wrote:

> ipfw add 13128 count tcp from any to me 3128
> ipfw add 13128 count tcp from me 3128 to any

2* die selbe Nummer (13128)? Schlecht... Hast du den Rechner vielleicht
rebootet und hast ein "ipfw -f flush" drinn der die deine Counter wieder
auf 0 setzt?
Ich hab mir da zum accounten ein kleines awk script geschrieben. muesste
um einzelne ports zu monitoren aber zugegebenermasen noch angepasst
werden. ich haengs trozdem mal ran. Installation: Pfad anpassen und unter
diesem die verz. "day", "week", "month" und "year" anlegen. cronjobs dann
wie folgt:

*/4 * * * * /usr/local/statistics/tools/ipfw_count.awk
59 23 * * * /usr/local/statistics/tools/ipfw_count.awk
 0 0 * * * /sbin/ipfw -q zero

die letzten beiden koennte man zur sicherheit auch noch mit && mergen. Am
besten betrachtest du das ganze auch nur als "denkanstoss" ;)

du kannst das ganze auch noch schoen mit MRTG "farbig" gestalten..

Title[ipfw2]: Traffic for 10.0.0.101 (ipfw) in and out
MaxBytes[ipfw2]: 1000000000
PageTop[ipfw2]: <h1>Traffic for 10.0.0.101 (ipfw) in and out</h1>
Target[ipfw2]: `ipfw show | awk '/^00305/ { print $3}' && ipfw show | awk
'/^00306/ { print $3}'`
LegendI[ipfw2]: &nbsp;in:
LegendO[ipfw2]: &nbsp;out:
WithPeak[ipfw2]: ymwd

usw.. es gibt viele moeglichkeiten ;)

  Gruesse, Oliver

-- 
 Oliver Lehmann
        @home: lehmann(at)ans-netz.de
      @office: oliver.lehmann(at)mgi.de
         @www: http://www.pofo.de/  |  http://wishlist.ans-netz.de/

To Unsubscribe: send mail to majordomo(at)de.FreeBSD.org
with "unsubscribe de-bsd-questions" in the body of the message

Received on Tue 04 Mar 2003 - 05:13:02 CET

search this site