Traffico internet sotto controllo
Traffico Internet sotto controllo tramite vnstat.
Vnstat è un’applicazione che permette di tenere sotto controllo il traffico Internet. In questo articolo, spiego come usarlo. Questa guida è stata provata su Ubuntu 10.10 con GNOME, ma può essere facilmente adattata per qualsiasi distribuzione di Linux.
Se vnstat non è già installato, installarlo tramite un gestore del software oppure , aprire un terminale, ed impartire il comando
sudo apt-get install vnstat
Per verificare gli accessi ad internet riconosciuti, impartire il comando
sudo vnstat –iflist
davanti a iflist, ci sono 2 segni – (meno)
dovreste ottenere un output simile a questo:
ubuntu10v10@ubuntu10v10:~$ sudo vnstat –iflist
[sudo] password for ubuntu10v10:
Available interfaces: lo eth0 wlan0
ubuntu10v10@ubuntu10v10:~$
L’output qui sopra significa che vnstat rileva una scheda Ethernet che chiama eth0, ed una scheda Wi-Fi che chiama wlan0.
Il più delle volte, questo passo è sufficiente per individuare correttamente l’hardware di collegamento ad Internet in uso al vostro computer.
Se così non fosse, date un’occhiata qui:
http://forum.ubuntu-it.org/index.php/topic,249770.msg3769406.html#msg3769406
Creare un database impartendo il comando
sudo vnstat -u -i eth0
(eventualmente sostituire eth0 col nome dell’interfaccia che si vuol monitorare; es.: se vogliamo monitorare la scheda wireless, impartire
sudo vnstat -u -i wlan0).
Per default, vnstat tiene sotto controllo eth0. Affinché svolga correttamente il proprio compito, dobbiamo configurare la scheda di rete che vogliamo tenere sotto osservazione; se non dovesse essere eth0, da terminale digitiamo
sudo gedit /etc/vnstat.conf
e sotto alla dicitura # default interface modifichiamo il valore Interface “eth0” con quello desiderato (ad es. wlan0 se vogliamo monitorare la scheda wireless).
Una volta installato, impartendo da terminale il comando
vnstat -d per conoscere il traffico internet giornaliero
vnstat -w per conoscere il traffico internet settimanale
vnstat -m per conoscere il traffico internet mensile
N.B: questa applicazione, tiene conto del traffico internet a partire da quando è stato installato, quindi non potete usarlo per conoscere il traffico internet relativo a periodi precedenti alla sua installazione.
Fornisco un esempio di output:
ubuntu10v10@ubuntu10v10:~$ vnstat -d
wlan0 / daily day rx | tx | total | avg. rate ------------------------+-------------+-------------+--------------- 11/19/11 130.68 MiB | 7.65 MiB | 138.33 MiB | 13.12 kbit/s 11/20/11 95.21 MiB | 8.95 MiB | 104.16 MiB | 9.88 kbit/s 11/21/11 149.72 MiB | 11.83 MiB | 161.55 MiB | 15.32 kbit/s 11/22/11 131.75 MiB | 9.48 MiB | 141.23 MiB | 13.39 kbit/s 11/23/11 118.14 MiB | 12.01 MiB | 130.15 MiB | 12.34 kbit/s 11/24/11 241.76 MiB | 13.04 MiB | 254.80 MiB | 24.16 kbit/s 11/25/11 149.74 MiB | 13.94 MiB | 163.69 MiB | 15.52 kbit/s 11/26/11 1.13 GiB | 55.66 MiB | 1.18 GiB | 114.99 kbit/s 11/27/11 267.44 MiB | 22.54 MiB | 289.98 MiB | 27.49 kbit/s 11/28/11 33.68 MiB | 5.85 MiB | 39.53 MiB | 3.75 kbit/s 11/29/11 35.89 MiB | 3.59 MiB | 39.48 MiB | 3.74 kbit/s 11/30/11 27.87 MiB | 3.06 MiB | 30.92 MiB | 2.93 kbit/s 12/02/11 53.87 MiB | 7.47 MiB | 61.34 MiB | 5.82 kbit/s 12/04/11 6.43 MiB | 1.24 MiB | 7.67 MiB | 1.16 kbit/s ------------------------+-------------+-------------+--------------- estimated 9 MiB | 1 MiB | 10 MiB |ubuntu10v10@ubuntu10v10:~$
Comments
Comment from Sargon6
Time 3 Dicembre 2011 at 14:59
http://forum.ubuntu-it.org/index.php/topic,249770.msg3769406.html#msg3769406.html
“http://forum.ubuntu-it.org/index.php/topic,249770.msg3769406.html#msg3769406.html”
Comment from Sargon6
Time 3 Dicembre 2011 at 14:54
Se interessati all’argomento, leggete anche qui:
http://forum.ubuntu-it.org/index.php/topic,249770.msg3769406.html#msg3769406http://forum.ubuntu-it.org/index.php/topic,249770.msg3769406.html#msg3769406