A tool analyze tcp packets with Lua.
./tcpkit
-s server ip.
-p port.
-i device.
-S lua script path, default is ../scripts/example.lua.
-l local address.
-C calculate bandwidth mode.
-d duration, take effect when -C is set.
-f log file.
-v version.
-h help.
$ cd tcpkit/src
$ make
$ ./tcpkit -p 11211 -C -d 10
calculate server bandwidth every 10 seconds.
[2016-05-13 16:15:49] [ERROR] You should use -l to assign local ip.
Just use -l option to set your local ip, for example sudo ./tcpkit -p 80 -l 192.168.4.1
.
[2016-05-13 16:18:46] [ERROR] may be you should assign device use -i and swith to root.
Just use -i option to set network device, for example sudo ./tcpkit -p 80 -l 192.168.4.1 -i bond0
.
See how to aquire device? use ifconfig
.
use ifconfig
sudo ./tcpkit -S ../scripts/example.lua -p 5555 -s 192.168.1.2
sudo ./tcpkit -S ../scripts/redis_mc_monitor.lua -p 6379 -s 192.168.1.2
sudo ./tcpkit -S ../scripts/dns_monitor.lua -p 53
sudo ./tcpkit -S ../scripts/kafka_monitor.lua -p 6379 -s 192.168.1.2