BSD sistemlerde systat ile ag baglanti durumu izleme

Linux/UNIX kullanirken sistemin durumunu izlemek icin cesitli araclar kullaniyoruz. Bunlardan cogu sistemle ilgili bilgileri kisaltmalarla vermekte boyle olunca da

ciktilari anlamak icin kisaltmalari ogrenmek -ve hatta ezberlemek- gerekiyor.

Bunun icin BSD sistemlerde systat kullanıyorum. systat *BSD sistemlerde anlık istatistiki bilgiler(network, cpu, disk vs) almak için kullanılan yararlı bir program.

Systat kullanarak sisteme ait gereksinim duyulan çoğu bilgi kolaylıkla alınabilir.

Temel kullanim sekli

#systat -parametre1 yenileme_sıklığı

parametre1 alanina icmp, icmp6,ifstat, iostat, ip, ip6, mbufs, netstat, pigs, swap, tcp, ve vmstat degerlerinden biri gelebilir.

Ağ arabirimlerinden geçen anlık trafik bilgisini öğrenme

#systat -ifstat 3

/0   /1   /2   /3   /4   /5   /6   /7   /8   /9   /10 Load Average   |

Interface           Traffic               Peak                Total

lo0  in      2.643 KB/s         64.832 KB/s          114.096 MB

out     2.643 KB/s         64.832 KB/s          114.096 MB

rl0  in      0.760 KB/s          9.843 KB/s            1.847 GB

out     0.692 KB/s         14.801 KB/s            2.827 GB

Sistemdeki TCP bağlantılarını detaylarıyla izleme

#systat -tcp 3

Benzer şekilde IP ya da UDP için bu bilgileri görmek isterseniz systat -ip 3 gibi bir komut kullanmaniz yeterli olacaktir.

Çıktılardan görüleceği üzere sisteme gidip gelen, başlatılan-bitirilen, sistem tarafından drop edilen vs gibi tüm bilgileri bu ekranlardan öğrenmek mümkün.

#systat -ip 3

Ek olarka benzeri  bilgileri netstat -s komutu ile de alabilirsiniz.

# netstat -s
tcp:
50220879 packets sent
27804549 data packets (2289655716 bytes)
2640114 data packets (1020647620 bytes) retransmitted
21501 data packets unnecessarily retransmitted
22 resends initiated by MTU discovery
15575605 ack-only packets (1907815 delayed)
0 URG only packets
26882 window probe packets
1566077 window update packets
4271371 control packets
54108096 packets received
22968367 acks (for 1939052448 bytes)
2696913 duplicate acks
702562 acks for unsent data
22520002 packets (3666957773 bytes) received in-sequence
1236209 completely duplicate packets (108638871 bytes)
1005 old duplicate packets
8064 packets with some dup. data (2852444 bytes duped)
987709 out-of-order packets (1195072888 bytes)
384806 packets (193404 bytes) of data after window
2243 window probes
275359 window update packets
483274 packets received after close
1731 discarded for bad checksums
0 discarded for bad header offset fields
0 discarded because packet too short
2093065 connection requests
1966700 connection accepts
1783770 bad connection attempts
6 listen queue overflows
14985 ignored RSTs in the windows
3939193 connections established (including accepts)
5175658 connections closed (including 1842248 drops)
1010969 connections updated cached RTT on close
1034932 connections updated cached RTT variance on close
581279 connections updated cached ssthresh on close
102065 embryonic connections dropped
17577915 segments updated rtt (of 19100017 attempts)
2544215 retransmit timeouts
100737 connections dropped by rexmit timeout
27395 persist timeouts
4 connections dropped by persist timeout
99331 keepalive timeouts
9 keepalive probes sent
99322 connections dropped by keepalive
2516844 correct ACK header predictions
15575640 correct data packet header predictions
2008351 syncache entries added
104480 retransmitted
50579 dupsyn
8618 dropped
1966700 completed
10 bucket overflow
0 cache overflow
29597 reset
11995 stale
6 aborted
0 badack
47 unreach
0 zone failures
0 cookies sent
10 cookies received
130941 SACK recovery episodes
185584 segment rexmits in SACK recovery episodes
266716092 byte rexmits in SACK recovery episodes
862762 SACK options (SACK blocks) received
798869 SACK options (SACK blocks) sent
0 SACK scoreboard overflow
udp:
8129165 datagrams received
0 with incomplete header
0 with bad data length field
1 with bad checksum
2971 with no checksum
60634 dropped due to no socket
6637 broadcast/multicast datagrams dropped due to no socket
0 dropped due to full socket buffers
0 not for hashed pcb
8061893 delivered
8709656 datagrams output
ip:
62195372 total packets received
0 bad header checksums
0 with size smaller than minimum
0 with data size < data length
0 with ip length > max ip packet size
0 with header length < data size
0 with data length < header length
0 with bad options
0 with incorrect version number
2 fragments received
0 fragments dropped (dup or out of space)
0 fragments dropped after timeout
1 packet reassembled ok
62160358 packets for this host
12455 packets for unknown/unsupported protocol
0 packets forwarded (0 packets fast forwarded)
0 packets not forwardable
0 packets received for unknown multicast group
0 redirects sent
63006964 packets sent from this host
2984 packets sent with fabricated ip header
0 output packets dropped due to no bufs, etc.
0 output packets discarded due to no route
0 output datagrams fragmented
0 fragments created
0 datagrams that can’t be fragmented
0 tunneling packets that can’t find gif
111 datagrams with bad address in header
icmp:
60634 calls to icmp_error
0 errors not generated in response to an icmp message
Output histogram:
echo reply: 5589
destination unreachable: 60634
0 messages with bad code fields
0 messages < minimum length
151 bad checksums
0 messages with bad length
0 multicast echo requests ignored
0 multicast timestamp requests ignored
Input histogram:
destination unreachable: 8810
source quench: 259
routing redirect: 115
echo: 5589
time exceeded: 3271
5589 message responses generated
0 invalid return addresses
0 no return routes
ICMP address mask responses are disabled

This entry was posted in FreeBSD, Network Tools. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

three × four =