安装使用tcpkit工具的时候,在make的时候报错
error: Neither flex nor lex was found.
解决方法:
yum install flex bison
tcpkit 是一个抓包工具
tcpkit 地址
tcpkit 支持redis,memcahed,http协议的抓包
简单用法如下:
the tcpkit was designed to make network packets programable with LUA by @git-hulk
-h, Print the tcpkit version strings, print a usage message, and exit
-i interface, Listen on network card interface
-r file, Read packets from file (which was created with the -w option or by other tools that write pcap)
-A Print each packet (minus its link level header) in ASCII. Handy for capturing web pages
-B buffer_size, Set the operating system capture buffer size to buffer_size, in units of KiB (1024 bytes)
-s snaplen, Snarf snaplen bytes of data from each packet rather than the default of 1500 bytes
-S file, Push packets to lua state if the script was specified
-t threshold, Print the request lantecy which slower than the threshold, in units of Millisecond
-w file, Write the raw packets to file
-p protocol, Parse the packet if the protocol was specified (supports: redis, memcached, http, raw)
-P stats port, Listen port to fetch the latency stats, default is 33333
For example:
`tcpkit -i eth0 tcp port 6379 -p redis` was used to monitor the redis reqeust latency
`tcpkit -i eth0 tcp port 6379 -p redis -w 6379.pcap` would also dump the packets to `6379.pcap`
`tcpkit -i eth0 tcp port 6379 -p redis -t 10` would only print the request latency slower than 10ms
网友评论