思科3560交換機接口流量抓取vbs腳本

爲了方便用戶查看交換機接口流量,客戶又不會登錄交換機,而且也沒有網管流量統計設備,索性寫了個vbs腳本,雖然簡陋,也可以一用。

on error resume next 
dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.run"cmd"
WshShell.AppActivate"d:\windows\system32\cmd.exe"
WScript.Sleep 200
WshShell.SendKeys"telnet 10.1.1.1"
WshShell.SendKeys"{ENTER}"
WshShell.SendKeys"username"   
WshShell.SendKeys"{ENTER}"
WshShell.SendKeys"password"
WshShell.SendKeys"{ENTER}"
WshShell.SendKeys"ena"
WshShell.SendKeys"{ENTER}"
WshShell.SendKeys"enable-password"
WshShell.SendKeys"{ENTER}"
WshShell.SendKeys"sh int summary | in ^\\* Giga|RXBS|TXBS|-"
WshShell.SendKeys"{ENTER}"
WshShell.SendKeys" "
WshShell.SendKeys"{ENTER}"

紅色爲IP和用戶名、密碼等,注意修改。
保存以上文本爲vbs,即可執行。需要提前打開telnet服務,兼容性未知,只測試過win10無問題。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章