如何通过命令行监视Windows上的网络通信
答
虽然tshark
真的很强大,如果你想有细粒度的统计数据(根据主机,协议......),它有主要的缺点是在它运行的时间段内收集统计数据。因此,它是只在报告“即时”的统计数据,但不以固定的点及时报告调查交通好有相处的日子,一周如何网络流量变化的看法,...
此外,由于tshark
使数据包捕获,有一些开销。
因此,根据您的需要,您可能会对MS Windows net
或netstat
命令感兴趣(netstat
可选择按协议报告统计信息)。 'net statistics [Server|workstation]'
或'netstat [-e|-s]'
是,据网络流量统计而言,Linux的'ifconfig'
的微软Windows当量(或'cat /proc/net/dev'
如果您愿意)。
请注意,如ifconfig
那样,net
或netstat
只会报告自从接口启动以来的数据量。
为了获得流量速率,你必须时间戳这些命令您的来电,并做了计算自己。
AFAIK,这两个命令都附带了所有最新的MS Windows版本。
答
Windows中的typeperf应该能够获取数据。
typeperf "\Network Interface(*)\....
typeperf -q "Network Interface" will list all the object
\Network Interface(*)\Bytes Total/sec
\Network Interface(*)\Packets/sec
\Network Interface(*)\Packets Received/sec
\Network Interface(*)\Packets Sent/sec
\Network Interface(*)\Current Bandwidth
\Network Interface(*)\Bytes Received/sec
\Network Interface(*)\Packets Received Unicast/sec
\Network Interface(*)\Packets Received Non-Unicast/sec
\Network Interface(*)\Packets Received Discarded
\Network Interface(*)\Packets Received Errors
\Network Interface(*)\Packets Received Unknown
\Network Interface(*)\Bytes Sent/sec
\Network Interface(*)\Packets Sent Unicast/sec
\Network Interface(*)\Packets Sent Non-Unicast/sec
\Network Interface(*)\Packets Outbound Discarded
\Network Interface(*)\Packets Outbound Errors
\Network Interface(*)\Output Queue Length
\Network Interface(*)\Offloaded Connections
+0
这个答案让我得到我的公式完整 尼克利用率=((总字节数\秒* 8)/当前带宽)* 100 – vicky 2018-02-06 07:34:06
这可能会更好,询问这对Serverfault – 2010-01-31 11:25:00
@KenKeenan像[SF/669580:通过CMD数据包捕获(https://serverfault.com/questions/669580/packet-capture-via-cmd)? – n611x007 2015-09-23 12:14:02