Tudo o que netstat
está fazendo é exibir estatísticas coletadas pelo kernel Linux em /proc/net/*
. Se você der uma olhada nesse diretório usando cat /proc/net/<endpoint>
, poderá ver todas as estatísticas não formatadas sendo coletadas.
Os detalhes disso são abordados para os vários endpoints que são abordados aqui: 3.3.7. / proc / net / .
arp — Lists the kernel's ARP table. This file is particularly useful for connecting a hardware address to an IP address on a system.
atm/ directory — The files within this directory contain Asynchronous Transfer Mode (ATM) settings and statistics. This directory is primarily used with ATM networking and ADSL cards.
dev — Lists the various network devices configured on the system, complete with transmit and receive statistics. This file displays the number of bytes each interface has sent and received, the number of packets inbound and outbound, the number of errors seen, the number of packets dropped, and more.
dev_mcast — Lists Layer2 multicast groups on which each device is listening.
igmp — Lists the IP multicast addresses which this system joined.
ip_conntrack — Lists tracked network connections for machines that are forwarding IP connections.
ip_tables_names — Lists the types of iptables in use. This file is only present if iptables is active on the system and contains one or more of the following values: filter, mangle, or nat.
ip_mr_cache — Lists the multicast routing cache.
ip_mr_vif — Lists multicast virtual interfaces.
netstat — Contains a broad yet detailed collection of networking statistics, including TCP timeouts, SYN cookies sent and received, and much more.
psched — Lists global packet scheduler parameters.
raw — Lists raw device statistics.
route — Lists the kernel's routing table.
rt_cache — Contains the current routing cache.
snmp — List of Simple Network Management Protocol (SNMP) data for various networking protocols in use.
sockstat — Provides socket statistics.
tcp — Contains detailed TCP socket information.
tr_rif — Lists the token ring RIF routing table.
udp — Contains detailed UDP socket information.
unix — Lists UNIX domain sockets currently in use.
wireless — Lists wireless interface data.
Exemplo
Se você cat /proc/net/igmp
:
[root@localhost ~]# cat /proc/net/igmp
Idx Device : Count Querier Group Users Timer Reporter
1 lo : 0 V3
010000E0 1 0:00000000 0
2 eth0 : 26 V2
260301E0 1 0:00000000 1
9B0101E0 1 0:00000000 1
439501E0 1 0:00000000 1
990101E0 1 0:00000000 1
580101E0 1 0:00000000 1
2A0301E0 1 0:00000000 1
290301E0 1 0:00000000 1
280301E0 1 0:00000000 1
9BD901E0 1 0:00000000 1
2D0301E0 1 0:00000000 1
2C0301E0 1 0:00000000 1
370301E0 1 0:00000000 1
050101E0 1 0:00000000 1
620201E0 1 0:00000000 1
040201E0 1 0:00000000 1
5F0101E0 1 0:00000000 1
520101E0 1 0:00000000 1
2BEF01E0 1 0:00000000 1
4D0101E0 1 0:00000000 1
E00C01E0 1 0:00000000 1
400301E0 1 0:00000000 1
FB0000E0 1 0:00000000 1
010000E0 1 0:00000000 0
3 eth1 : 5 V2
FB0000E0 1 0:00000000 1
010000E0 1 0:00000000 0