===== tcpdump ===== 捕获网卡数据包 * tcpdump [tcp,udp,icmp] [-i eth0] [-nn] [[host ip] and port ! 80 ] - 协议 - 网卡 - 不把端口装换成通用协议名称(如果端口是80,可能会转换成http) - 指定主机和端口(主机和端口都可以取反) **常用语法** * tcpdump -i eth0 -nn host 10.211.55.2 and host ! 80 > tmp.txt ===== iostat ===== * iostat -k 1 5 (以kb为单位,间隔1秒,连续采集5次) ===== cpu ===== * cat /proc/cpuinfo|grep "processor"|wc -l #逻辑CPU的个数 * cat /proc/cpuinfo |grep "physical id"|sort|uniq|wc -l #物理CPU的个数 * cat /proc/cpuinfo |grep cores|uniq #查看CPU是几核 * cat /proc/cpuinfo |grep MHz|uniq #查看CPU的主频 * top -n 2 -b > tmp.txt # 将2次top命令的结果重定向到tmp.txt中,供下次分析 ===== 内存 ===== * free * top -n 2 -b > tmp.txt ===== 磁盘 ===== * df -h