安裝需要的環(huán)境
yum install libpcap-devel ruby-devel rubygems git
gem install ruby-pcap -v '0.7.8'
gem install bundle
gem install rake
下載源碼安裝
git clone https://github.com/etsy/mctop
cd mctop
bundle install
rake install
安裝完畢
用法
Usage: mctop [options]
-i, --interface=NIC Network interface to sniff (required)
-p, --port=PORT Network port to sniff on (default 11211)
-d, --discard=THRESH Discard keys with request/sec rate below THRESH
-r, --refresh=MS Refresh the stats display every MS milliseconds
-h, --help Show usage info
通過ifconfig查看網(wǎng)卡,我的是eth0。可以通過下面的命令監(jiān)控
./bin/mctop -i eth0 -p 10021