2010-01-31 67 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