使用sar命令,统计网卡eno2流量.
以10次平均值作为统计结果.
sar -n DEV 1 10 | grep Average |grep eno2 | awk '{print "\tdevice:",$2,"\t","input:","\t",$5*1000*8,"bps","\n","\tdevice:",$2,"\t","output:","\t",$6*1000*8,"bps"}'
使用sar命令,统计网卡eno2流量.
以10次平均值作为统计结果.
sar -n DEV 1 10 | grep Average |grep eno2 | awk '{print "\tdevice:",$2,"\t","input:","\t",$5*1000*8,"bps","\n","\tdevice:",$2,"\t","output:","\t",$6*1000*8,"bps"}'