• Willkommen im Linux Club - dem deutschsprachigen Supportforum für GNU/Linux. Registriere dich kostenlos, um alle Inhalte zu sehen und Fragen zu stellen.

iftop

catweasel

Hacker
Hi!

Ich bräuchte den Wert "Total" der iftop-Ausgabe, um ihn in einem Skript weiterverarbeiten zu können.
Gibt es eine Möglichkeit, an diesen Wert zu gelangen?
 

ThomasF

Hacker
@snaewe

schau dir mal die Ausgabe von iftop als root an ... dann weißt du was er meint ;)

@catweasel

Mit iftop kann ich dir leider nicht helfen ... aber schau dir doch mal iptraf an ... dort kannst du "logging" aktivieren und dann die Logfiles die z.B nach /var/log/iptraf geschrieben werden auswerten ... die lan_statistics sehen ganz gut aus ...

Hier mal ein Auszug aus meinen Logs ( nur ganz kurz gelaufen) :



Code:
*** LAN traffic log, generated Fri Sep 28 14:13:12 2007


Ethernet address: 00112f0fd9d7
        Incoming total 5687 packets, 7889694 bytes; 0 IP packets
        Outgoing total 3010 packets, 192835 bytes; 0 IP packets
        Average rates: 942.04 kbits/s incoming, 23.01 kbits/s outgoing
        Last 5-second rates: 0.00 kbits/s incoming, 0.00 kbits/s outgoing

Ethernet address: 00a0c5c003ea
        Incoming total 3010 packets, 192835 bytes; 0 IP packets
        Outgoing total 5687 packets, 7889694 bytes; 0 IP packets
        Average rates: 23.01 kbits/s incoming, 942.04 kbits/s outgoing
        Last 5-second rates: 0.00 kbits/s incoming, 0.00 kbits/s outgoing

Running time: 67 seconds
Fri Sep 28 14:13:12 2007; ******** LAN traffic monitor stopped ********

Vielleicht hilft dir das weiter

So long

ThomasF
 

ThomasF

Hacker
Ahhh,

ok sorry ... jetzt sehe ich was du meinst ;)

Wenn er den ersten KB Wert unter "Total" meint dann ist es der "cumm" also aufaddierte Wert ...

Unter iptraf in der iface_stats_general.log sieht das dann so aus :

Code:
eth0: 5607 total, 5607 IP, 0 non-IP, 0 IP checksum errors, average activity 237.55 kbits/s, peak activity 1423.60 kbits/s, last 5-second activity 0.00 kbits/s

So long

ThomasF
 

snaewe

Hacker
ThomasF schrieb:
Ahhh,

ok sorry ... jetzt sehe ich was du meinst ;)
Na, geht doch...

ThomasF schrieb:
Wenn er den ersten KB Wert unter "Total" meint dann ist es der "cumm" also aufaddierte Wert ...

Und genaus das war das Problem der ursprünglichen Frage. Ich will nicht raten.
catweasel sollte einfach sagen, welchen Wert er haben will, denn der
Total Wert bei iftop gibt doch wohl an, wieviel seit dem Start des Programms gesendet/empfangen wurde, oder ?

Also catweasel, wenn du Lust hast, sag doch mal, was du eigentlich erreichen willst.

S.
 

ThomasF

Hacker
Ok ok ...

hab ich noch mal daneben gelegen ... wenn er die bisherige Gesammtzahl an KB für dieses Interface sucht braucht er wieder ein anderes Log ...

Also vielleicht das hier:


Code:
Fri Sep 28 14:37:41 2007; ******** Detailed interface statistics started ********

*** Detailed statistics for interface eth0, generated Fri Sep 28 14:40:05 2007

Total:  728 packets, 367285 bytes
        (incoming: 321 packets, 171933 bytes; outgoing: 407 packets, 195352 bytes)
IP:     728 packets, 357001 bytes
        (incoming: 321 packets, 167347 bytes; outgoing: 407 packets, 189654 bytes)
TCP: 726 packets, 356820 bytes
        (incoming: 320 packets, 167237 bytes; outgoing: 406 packets, 189583 bytes)
UDP: 2 packets, 181 bytes
        (incoming: 1 packets, 110 bytes; outgoing: 1 packets, 71 bytes)
ICMP: 0 packets, 0 bytes
        (incoming: 0 packets, 0 bytes; outgoing: 0 packets, 0 bytes)
Other IP: 0 packets, 0 bytes
        (incoming: 0 packets, 0 bytes; outgoing: 0 packets, 0 bytes)
Non-IP: 0 packets, 0 bytes
        (incoming: 0 packets, 0 bytes; outgoing: 0 packets, 0 bytes)
Broadcast: 0 packets, 0 bytes

Average rates:
2.49 kbytes/s, 5.06 packets/s
Incoming:       1.16 kbytes/s, 2.23 packets/s
Outgoing:       1.32 kbytes/s, 2.83 packets/s

Peak total activity: 13.52 kbytes/s, 26.60 packets/s
Peak incoming rate: 6.62 kbytes/s, 11.80 packets/s
Peak outgoing rate: 8.89 kbytes/s, 14.80 packets/s

IP checksum errors: 0

Running time: 144 seconds
Fri Sep 28 14:40:05 2007; ******** Detailed interface statistics stopped ********

Das soll aber nun reichen *fg*

So long

ThomasF
 

snaewe

Hacker
ThomasF schrieb:
Ok ok ...

hab ich noch mal daneben gelegen ... wenn er die bisherige Gesammtzahl an KB für dieses Interface sucht braucht er wieder ein anderes Log ...

Also vielleicht das hier:
[snip]

Oder einfach mal in '/proc/dev/net' reinschauen.

S.
 
Oben