AW: [linux-l] Trafficzaehlen

Schlomo Schapiro belug at schlomo.schapiro.org
Di Nov 22 21:38:00 CET 2005


Hallo,

Meinst Du sowas: http://lucky/mrtg/dsl/ ? Da fuehren i.d.T. viele Wege 
hin, bei mir ist es MRTG zum Graphiken machen und ein kleines Skript fuer 
das auslesen der ppp Verbindung des DSL:

mrtg.conf:

RunAsDaemon:    No
Interval:       5
WorkDir:        /home/www/htdocs/mrtg

Target[dsl]:    `/home/www/conf/ppp2mrtg`
Title[dsl]:     Q-DSL Connection
Directory[dsl]: dsl
MaxBytes[dsl]:  131072

ppp2mrtg:

#!/bin/bash
set `{ /usr/sbin/pppstats -a ppp0 || echo 0 0 0 0 0 0 0 ; } | awk 
'/[0..9]+/ { print $1,$7 }'`
echo $1
echo $2
#set -x
if [ -r /var/log/ppp0.connected ] ; then
        ONLINE=$((`date +%s`-`cat /var/log/ppp0.connected`))
        OTEXT=""
        if [ $ONLINE -gt 86400 ] ; then
                let DAYS=ONLINE/86400
                let ONLINE=ONLINE%86400
                OTEXT="$DAYS days "
        fi
        if [ $ONLINE -gt 3600 ] ; then
                let HOURS=ONLINE/3600
                let ONLINE=ONLINE%3600
                OTEXT="$OTEXT$HOURS hours "
        fi
        if [ $ONLINE -gt 60 ] ; then
                let MINUTES=ONLINE/60
                let ONLINE=ONLINE%60
                OTEXT="$OTEXT$MINUTES minutes "
        fi
        OTEXT="$OTEXT$ONLINE seconds"
else
        OTEXT="currently not connected"
fi
#set +x
echo $OTEXT
echo "DSL Interface (ppp0)"

und in /etc/ppp/ip-up:

date +%s >/var/log/$IF.connected

Aber vielleicht hast Du ja was anderes, wo man dann eben so eine Loesung 
etwas anpasst. 

Gruss,
Schlomo

On Mon, 21 Nov 2005, Christian Herzberg wrote:

> Von: Benjamin Schieder [mailto:blindcoder at scavenger.homeip.net] 
> 
> > Ich hab mir mal die Freiheit genommen, fuer dich einen Betreff einzufuegen.
> 
> Besten Damk
> 
> > On Mon, Nov 21, 2005 at 12:18:15PM +0100, Christian Herzberg wrote:
> >> Hallo,
> >> 
> >> Hat jemand eine Idee wie ich meinen Traffic auf meinem GW monitoren 
> >> kann? Wir haben mehre Au?enstellen und wollen nun genau wissen wie 
> >> viel Traffic diese verursachen. Ich habe mitteld iptables Regeln 
> >> erstellt die den Traffic erstmal z?hlen.
> >> 
> >> Iptables -A FORWARD -s $zentrale -d $club1 -j ACCEPT
> >> Iptables -A FORWARD -d $zentrale -s $club1 -j ACCEPT
> >> 
> >> Das ist schon nicht schlecht, aber ich dachte da mehr an was 
> >> grafisches. Das ganze sollte dann auch noch auf einen anderen rechner 
> >> gesammelt und dargestellt werden.
> 
> >MRTG? http://www.mrtg.org/
> >UTA Dragon? http://freshmeat.net/projects/utadragon/
> 
> 
> Besten Dank
> Christian
> _______________________________________________
> linux-l mailing list
> linux-l at mlists.in-berlin.de
> Die Mailingliste der BeLUG (Berliner Linux User Group)
> 
> Wenn du diese Mailingliste  abbestellen willst, gehe bitte auf
> https://mlists.in-berlin.de/mailman/listinfo/linux-l
> und trage dich dort bitte aus
> 

-- 
Regards,
Schlomo



Mehr Informationen über die Mailingliste linux-l