`
BucketLi
  • 浏览: 190082 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
博客专栏
5a76a659-f8e6-3bf3-b39a-8ae8f7a0f9d9
Percolator与分布...
浏览量:5551
社区版块
存档分类
最新评论

Linux抓包以及分析包指令

 
阅读更多

1. 抓包

引用
tcpdump -i 网卡名 -s0 -C 10 -Z root -w app_server.pcap


-C 后参数表示文件大小,MB 为单位

2. 分析包

安装wireshark

引用
yum install wireshark


接下来就是写指令分析包了,以分析 mysql 3306 端口 response 时间段聚合为例

引用
tshark -r app_server.pcap -Y " (tcp.srcport eq 3306 and tcp.len>67 )" -o tcp.calculate_timestamps:true -T fields -e frame.number -e frame.time_epoch  -e frame.time_delta_displayed  -e ip.src -e tcp.srcport -e tcp.dstport -e ip.dst -e tcp.time_delta -e tcp.stream -e tcp.len | awk '{ sum=sum+$8; count=count+1 } END{ print sum/count }'
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics