Auteur Sujet: Mesurer sa consomation internet sous linux  (Lu 10848 fois)

0 Membres et 1 Invité sur ce sujet

vivien

  • Administrateur
  • *
  • Messages: 47 175
    • Twitter LaFibre.info
Mesurer sa consomation internet sous linux
« Réponse #12 le: 09 décembre 2018 à 19:23:47 »
Ah oui pour être détaillé, c'est détaillé...

Le serveur fr.archive.ubuntu.com après 12h d'uptime (je l'ai redémarré ce matin pour une mise à jour de sécurité) :
$ netstat -s
Ip:
    Forwarding: 2
    897706030 total packets received
    0 forwarded
    0 incoming packets discarded
    897706018 incoming packets delivered
    842507012 requests sent out
    24 outgoing packets dropped
    14 reassemblies required
    7 packets reassembled ok
Icmp:
    30842 ICMP messages received
    441 input ICMP message failed
    InCsumErrors: 10
    Histogramme d'entrée ICMP
        destination unreachable: 3046
        timeout in transit: 75
        echo requests: 27711
    28430 ICMP messages sent
    0 ICMP messages failed
    Histogramme de sortie ICMP
        destination unreachable: 719
        echo replies: 27711
IcmpMsg:
        InType3: 3046
        InType8: 27711
        InType11: 75
        OutType0: 27711
        OutType3: 719
Tcp:
    3869 active connection openings
    981838 passive connection openings
    137505 failed connection attempts
    54034 connection resets received
    155 connections established
    1168954331 segments received
    2772302756 segments sent out
    22505289 segments retransmitted
    1115 bad segments received
    120252 resets sent
    InCsumErrors: 1107
Udp:
    36 packets received
    719 packets to unknown port received
    0 packet receive errors
    84 packets sent
    0 receive buffer errors
    0 send buffer errors
UdpLite:
TcpExt:
    5024 SYN cookies sent
    4809 SYN cookies received
    1945 invalid SYN cookies received
    137505 resets received for embryonic SYN_RECV sockets
    217 ICMP packets dropped because they were out-of-window
    381167 TCP sockets finished time wait in fast timer
    486520 packetes rejected in established connections because of timestamp
    281787 delayed acks sent
    3322 delayed acks further delayed because of locked socket
    Quick ack mode was activated 48646 times
    242 SYNs to LISTEN sockets dropped
    3652334 packet headers predicted
    284546581 acknowledgments not containing data payload received
    868488556 predicted acknowledgments
    3859 times recovered from packet loss due to fast retransmit
    TCPSackRecovery: 3536773
    TCPSACKReneging: 2028
    Detected reordering 7747406 times using SACK
    Detected reordering 9135 times using reno fast retransmit
    Detected reordering 114524 times using time stamp
    5262 congestion windows fully recovered without slow start
    71175 congestion windows partially recovered using Hoe heuristic
    TCPDSACKUndo: 8972
    25179 congestion windows recovered without slow start after partial ack
    TCPLostRetransmit: 669240
    313 timeouts after reno fast retransmit
    TCPSackFailures: 2948
    35806 timeouts in loss state
    20845871 fast retransmits
    998422 retransmits in slow start
    TCPTimeouts: 187566
    TCPLossProbes: 631016
    TCPLossProbeRecovery: 12360
    TCPRenoRecoveryFail: 515
    TCPSackRecoveryFail: 140641
    TCPDSACKOldSent: 51156
    TCPDSACKOfoSent: 358
    TCPDSACKRecv: 810825
    TCPDSACKOfoRecv: 170262
    18349 connections reset due to unexpected data
    2219 connections reset due to early user close
    5792 connections aborted due to timeout
    TCPSACKDiscard: 76297
    TCPDSACKIgnoredOld: 40729
    TCPDSACKIgnoredNoUndo: 553182
    TCPSpuriousRTOs: 7631
    TCPSackShifted: 41756978
    TCPSackMerged: 64986968
    TCPSackShiftFallback: 22305484
    TCPDeferAcceptDrop: 1087676
    IPReversePathFilter: 5
    TCPReqQFullDoCookies: 5024
    TCPRcvCoalesce: 709080
    TCPOFOQueue: 16876
    TCPOFOMerge: 360
    TCPChallengeACK: 8026
    TCPSYNChallenge: 10
    TCPFastOpenCookieReqd: 27
    TCPAutoCorking: 454625
    TCPFromZeroWindowAdv: 50
    TCPToZeroWindowAdv: 50
    TCPWantZeroWindowAdv: 35712
    TCPSynRetrans: 103091
    TCPOrigDataSent: 2768587626
    TCPHystartTrainDetect: 78729
    TCPHystartTrainCwnd: 12215952
    TCPHystartDelayDetect: 174985
    TCPHystartDelayCwnd: 12571510
    TCPACKSkippedSynRecv: 191
    TCPACKSkippedPAWS: 441135
    TCPACKSkippedSeq: 52631
    TCPACKSkippedFinWait2: 40
    TCPACKSkippedTimeWait: 891
    TCPACKSkippedChallenge: 11235
    TCPWinProbe: 61978
IpExt:
    InOctets: 50818050809
    OutOctets: 2938220564214
    InNoECTPkts: 897650554
    InECT1Pkts: 169
    InECT0Pkts: 82434
    InCEPkts: 5255

Optix

  • AS41114 - Expert OrneTHD
  • Abonné Orne THD
  • *
  • Messages: 4 665
  • WOOHOO !
    • OrneTHD
Mesurer sa consomation internet sous linux
« Réponse #13 le: 10 décembre 2018 à 09:56:38 »
vnstat :)

doctorrock

  • Abonné Orange Fibre
  • *
  • Messages: 932
  • Draguignan 83
Mesurer sa consomation internet sous linux
« Réponse #14 le: 12 décembre 2018 à 19:22:12 »
vnstat :)

nstat plutot non ? Du paquet iproute2

willemijns

  • Abonné FreeMobile
  • *
  • Messages: 2 681
Mesurer sa consomation internet sous linux
« Réponse #15 le: 12 décembre 2018 à 21:16:11 »
nan

voici mon code bourrin pour l'installer sous ubuntu 18.04 LTS

# Ne sert qu'a faire du daily, monthly BW...

# 1 Gib = 1,024GB... donc c'est affiché en realité 2,4% moins que en GB

sudo apt-get install vnstat
# liste les interfaces disponibles
vnstat --iflist
read $r
sudo chown -R vnstat:vnstat /var/lib/vnstat
# (Je suis en WiFi donc j'utilise la ligne suivante qui n'est pas commentée) sudo vnstat -u -i enp0s7
sudo vnstat -u -i wlx10feed25f5ac
sudo chown -R vnstat:vnstat /var/lib/vnstat
# lance les services en permanence: c l'une ou l'autre commande G mis les 2 ;)
sudo /etc/init.d/vnstat start
sudo systemctl enable vnstat.service

sudo /etc/init.d/vnstat status
sudo systemctl status vnstat

# MAJ auto toutes les 5 minutes sinon on force comme ceci:
# (Je suis en WiFi donc j'utilise la ligne suivante qui n'est pas commentée) sudo vnstat -u -i enp0s7 && vnstat -d
sudo vnstat -u -i wlx10feed25f5ac && vnstat -d -i wlx10feed25f5ac

=>

wlx10feed25f5ac  /  daily

         day         rx      |     tx      |    total    |   avg. rate
     ------------------------+-------------+-------------+---------------
     09/12/2018     X,66 GiB |  X21,54 MiB |    X,78 GiB |  176,88 kbit/s
     10/12/2018     X,53 GiB |  X58,61 MiB |    X,78 GiB |  276,67 kbit/s
     11/12/2018     X,74 GiB |  X71,96 MiB |    X,91 GiB |  189,92 kbit/s
     12/12/2018     X,06 GiB |  X82,33 MiB |    X,24 GiB |  251,68 kbit/s
     ------------------------+-------------+-------------+---------------
     estimated     XX,33 GiB |     XX05 MiB |   XX,53 GiB |