2010-01-31 129 views
3

如何通过命令行监视Windows上的网络通信;特别是下载/上传速度和上传/下载的数据量?是否有脚本/批处理?如何通过命令行监视Windows上的网络通信

+0

这可能会更好,询问这对Serverfault – 2010-01-31 11:25:00

+0

@KenKeenan像[SF/669580:通过CMD数据包捕获(https://serverfault.com/questions/669580/packet-capture-via-cmd)? – n611x007 2015-09-23 12:14:02

回答

3

您可以使用tshark和-z <statistics>参数。只搜索Wireshark。它是开源和多平台。

7

虽然tshark真的很强大,如果你想有细粒度的统计数据(根据主机,协议......),它有主要的缺点是在它运行的时间段内收集统计数据。因此,它是只在报告“即时”的统计数据,但不以固定的点及时报告调查交通好有相处的日子,一周如何网络流量变化的看法,...

此外,由于tshark使数据包捕获,有一些开销。

因此,根据您的需要,您可能会对MS Windows netnetstat命令感兴趣(netstat可选择按协议报告统计信息)。 'net statistics [Server|workstation]''netstat [-e|-s]'是,据网络流量统计而言,Linux的'ifconfig'的微软Windows当量(或'cat /proc/net/dev'如果您愿意)。

请注意,如ifconfig那样,netnetstat只会报告自从接口启动以来的数据量。

为了获得流量速率,你必须时间戳这些命令您的来电,并做了计算自己。

AFAIK,这两个命令都附带了所有最新的MS Windows版本。

3

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