【正文】
示例 使用 stat a 命令 活動的 Inter 連接(包括服務器) Proto RecvQ SendQ Local Address Foreign Address (state) tcp4 0 0 *.daytime *.* LISTEN tcp 0 0 *.ftp *.* LISTEN tcp 0 0 *.tel *.* LISTEN tcp4 0 0 *.smtp *.* LISTEN tcp4 0 0 *.time *.* LISTEN tcp4 0 0 *.sunrpc *.* LISTEN tcp4 0 0 *.smux *.* LISTEN tcp 0 0 *.exec *.* LISTEN tcp 0 0 *.login *.* LISTEN tcp 0 0 *.shell *.* LISTEN tcp4 0 0 *.printer *.* LISTEN tcp4 0 0 *.rmc *.* LISTEN tcp4 0 0 *.sco_prin *.* LISTEN tcp4 0 0 *.sco_s5_p *.* LISTEN tcp4 0 0 *.file *.* LISTEN tcp4 0 0 *.file *.* LISTEN tcp4 0 0 *.file *.* LISTEN tcp4 0 0 *.wsmserve *.* LISTEN tcp4 0 0 ESTABLISHED tcp4 0 0 ESTABLISHED tcp4 0 0 ESTABLISHED tcp4 0 0 ESTABLISHED tcp4 0 0 ESTABLISHED tcp4 0 0 ESTABLISHED tcp4 0 0 ESTABLISHED tcp4 0 0 ESTABLISHED tcp4 0 0 ESTABLISHED tcp4 0 0 ESTABLISHED tcp4 0 17 ESTABLISHED tcp4 0 0 ESTABLISHED tcp4 0 0 ESTABLISHED tcp4 0 0 ESTABLISHED udp4 0 0 *.daytime *.* udp4 0 0 *.time *.* udp4 0 0 *.sunrpc *.* udp4 0 0 *.snmp *.* udp4 0 0 *.syslog *.* udp4 0 0 *.ntalk *.* udp4 0 0 *.rmc 。 示例 顯示協(xié)議統(tǒng)計信息 stat s icmp: 5286 calls to icmp_error 0 errors not generated because old message was icmp Output histogram: echo reply: 161 destination unreachable: 5286 0 messages with bad code fields 0 messages minimum length 0 bad checksums 0 messages with bad length Input histogram: echo reply: 13340245 destination unreachable: 5277 echo: 161 161 message responses generated igmp: 34 messages received 0 messages received with too few bytes 0 messages received with bad checksum 0 membership queries received 0 membership queries received with invalid field(s) 34 membership reports received 0 membership reports received with invalid field(s) 34 membership reports received for groups to which we belong 4 membership reports sent tcp: 83954 packets sent 75656 data packets (27181497 bytes) 558 data packets (945603 bytes) retransmitted 6237 ackonly packets (4732 delayed) 0 URG only packets . . . (省略的行) . . . udp: 178123 datagrams received 0 inplete headers 0 bad data length fields 0 bad checksums 5287 dropped due to no socket 154419 broadcast/multicast datagrams dropped due to no socket 0 socket buffer overflows 18417 delivered 23689 datagrams output ip: 14076261 total packets received 0 bad header checksums 0 with size smaller than minimum 0 with data size data length 0 with header length data size 0 with data length header length 0 with bad options 0 with incorrect version number 644016 fragments received . . . (省略的行) . . . ipv6: 0 total packets received 0 with size smaller than minimum 0 with data size data length . . . (省略的行) . . . icmpv6: 0 calls to icmp6_error 0 errors not generated because old message was icmpv6 Output histogram: unreachable: 0 packets too big: 0 time exceeded: 0 . . . (省略的行) . . . stat p ip ip: 14077033 total packets received 0 bad header checksums 0 with size smaller than minimum 0 with data size data length 0 with header length data size 0 with data length header length 0 with bad options 0 with incorrect version number 644016 fragments received 0 fragments dropped (dup or out of space) 0 fragments dropped after timeout 181998 packets reassembled ok 13609226 packets for this host . . . (省略的行) 套接字 要顯示有關系統(tǒng)上使用的套接字的信息,可以使用 stat –a 命令,如下面的示例所示。 協(xié)議統(tǒng)計信息 可以使用 stat –s 命令顯示所有協(xié)議的統(tǒng)計信息,或者使用 stat –p 命令顯示特定協(xié)議的統(tǒng)計信息,如下面的示例 所示。 Media Speed Running 適配器的當前連接速度。 Link Status 接口的當前狀態(tài)。 No mbuf Errors mbufs 對設備驅(qū)動程序不可用的次數(shù)。 Current HW Transmit Queue Length 硬件傳輸隊列上當前存在的傳出數(shù)據(jù)包數(shù)量。 S/W Transmit Queue Overflow 已溢出軟件傳輸隊列的傳出數(shù)據(jù)包總數(shù)。這是由于硬件 /網(wǎng)絡錯誤導致的失敗傳輸?shù)挠嫈?shù)器。 Packets 成功傳輸?shù)臄?shù)據(jù)包數(shù)量。 Hardware Address 適配器的 MAC 地址。數(shù)據(jù)將使用 stat 命令來生成。 示例 使用 stat m 命令顯示 mbuf 統(tǒng)計信息 Kernel malloc statistics: ******* CPU 0 ******* By size inuse calls failed delayed free hiwat freed 32 32 45 0 0 96 4852 0 64 49 56964