====== Ferramentas de monitoramento ====== ===== vnstat ===== VnStat is a console based network traffic monitoring tool design for Linux and BSD. It will keep a log of the network traffic for a selected network interface/s. To generate the logs, vnStat uses the information provided by the kernel. In other words it will not sniff the network traffic and will ensue the lite usage of the system resource. To use this software under Linux you will need at least version 2.2 of the kernel series {{ :infra-estrutura:linux:darkstat01.png?direct&600 |}} root@linux:~# vnstat --help vnStat 1.18 by Teemu Toivola -q, --query query database -h, --hours show hours -d, --days show days -m, --months show months -w, --weeks show weeks -t, --top10 show top 10 days -s, --short use short output -u, --update update database -i, --iface select interface (default: eth0) -?, --help short help -v, --version show version -tr, --traffic calculate traffic -ru, --rateunit swap configured rate unit -l, --live show transfer rate in real time See also "--longhelp" for complete options list and "man vnstat". root@linux:~# Consumo por horas root@linux:~# vnstat -h enp0s3 16:53 ^ r | r | r | r | rt | rt | rt | rt | rt | rt r r -+---------------------------------------------------------------------------> | 17 18 19 20 21 22 23 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 h rx (KiB) tx (KiB) ][ h rx (KiB) tx (KiB) ][ h rx (KiB) tx (KiB) 17 0 0 ][ 01 0 0 ][ 09 0 0 18 0 0 ][ 02 0 0 ][ 10 0 0 19 0 0 ][ 03 0 0 ][ 11 0 0 20 0 0 ][ 04 0 0 ][ 12 0 0 21 0 0 ][ 05 0 0 ][ 13 0 0 22 0 0 ][ 06 0 0 ][ 14 4,864 2,981 23 0 0 ][ 07 0 0 ][ 15 790 9 00 0 0 ][ 08 0 0 ][ 16 673 10 root@linux:~# Consumo por dias root@linux:~# vnstat -d enp0s3 / daily day rx | tx | total | avg. rate ------------------------+-------------+-------------+--------------- 06/17/2019 3.77 GiB | 7.13 MiB | 3.78 GiB | 375.47 kbit/s 06/18/2019 7.21 MiB | 7.82 MiB | 15.03 MiB | 1.46 kbit/s 06/19/2019 6.18 MiB | 2.93 MiB | 9.11 MiB | 1.26 kbit/s ------------------------+-------------+-------------+--------------- estimated 8 MiB | 2 MiB | 10 MiB | root@linux:~# É possível utilizar o vnstat para gerar uma imagem png, utilize root@linux:~# vnstati -h -i enp0s3 -o ~/network-horas.png root@linux:~# vnstati -d -i enp0s3 -o ~/network-diario.png root@linux:~# {{ :infra-estrutura:linux:network-horas.png?direct&600 |}} {{ :infra-estrutura:linux:network-horas.png?direct&600 |}} ===== iftop ===== iftop is a simple, easy to use, real time top-like command line based network bandwidth monitoring tool, used to get a quick overview of network activities on an interface. It displays network usage bandwidth updates every 2, 10 and 40 seconds on average. {{ :infra-estrutura:linux:untitled1.png?direct&600 |}} ===== nload ===== nload is a another simple, easy to use command-line tool for monitoring network traffic and bandwidth usage in real time. It uses graphs to help you monitor inbound and outbound traffic. In addition, it also displays information such as the total amount of transfered data and min/max network usage. {{ :infra-estrutura:linux:nload.png?direct&600 |}} ===== nethogs ===== NetHogs is a tiny top-like, text-based tool to monitor real time network traffic bandwidth usage by each process or application running on a Linux system. It simply offers real time statistics of your network bandwidth usage on a per-process basis. {{ :infra-estrutura:linux:nethogs.png?direct&600 |}} ===== bmon ===== bmon is also a straightforward command line tool for monitoring network bandwidth utilization and a rate estimator, in Linux. It captures network statistics and visualizes them in a human friendly format so that you can keep an eye on your system. {{ :infra-estrutura:linux:bmon.png?direct&600 |{{ :infra-estrutura:linux:bmon.png?direct&600 |}}}} ===== cbm ===== CBM is a tiny command line utility for displaying current network traffic on all connected devices in colored output in Ubuntu Linux and its derivatives such as Linux Mint, Lubuntu and many others. It shows each connected network interface, bytes received, bytes transmitted and total bytes, allowing you to monitor network bandwidth. {{ :infra-estrutura:linux:cbm.png?direct&600 |}} ===== netperf ===== Netperf is similar to iperf, for testing network performance. It can help in monitoring network bandwidth in Linux by measuring data transfer using either TCP, UDP. It also supports measurements via Berkeley Sockets interface, DLPI, Unix Domain Sockets and so many other interfaces. You need a server and a client to run tests. {{ :infra-estrutura:linux:netperf-network-bandwidth-testing.gif?direct&600 |}} {{ :infra-estrutura:linux:netperf01.png?direct&600 |}} ===== iptraf ===== IPTraf is an easy to use, ncurses-based and configurable tool for monitoring incoming and outgoing network traffic passing through an interface. It is useful for IP traffic monitoring, and viewing general interface statistics, detailed interface statistics and so much more. {{ :infra-estrutura:linux:iptraf.png?direct&600 |}} ===== darkstat ===== Darkstat is a small, simple, cross-platform, real-time, efficient web-based network traffic analyzer. It is a network statistics monitoring tool that works by capturing network traffic, computes usage statistics, and serves the reports over HTTP in a graphical format. You can also use it via the command line to get the same results. Execute root@linux:~# darkstat -i enp0s3 root@linux:~# Depois acesse via http na porta 667 {{ :infra-estrutura:linux:darkstat.png?direct&600 |}}