' nettraffic.vbs ' Pandora FMS Agent Plugin for Microsoft Windows (All platfforms) ' (c) 2014 Sancho Lerena ' Returns total bytes in network since bootup and % of network use ' ---------------------------------------------------------------- ' usage: cscript //B nettraffic.vbs strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\Root\CIMV2") Set colItems = objWMIService.ExecQuery _ ("select * from Win32_PerfRawData_Tcpip_NetworkInterface ") BytesSUM = 0 For Each objItem in colItems bytesTotal = objitem.BytesTotalPersec * 8 BytesSUM = BytesSUM + bytesTotal Next Wscript.StdOut.WriteLine "" Wscript.StdOut.WriteLine " " Wscript.StdOut.WriteLine " " Wscript.StdOut.WriteLine " bytes/sec" Wscript.StdOut.WriteLine " generic_data_inc" Wscript.StdOut.WriteLine " " Wscript.StdOut.WriteLine "" Wscript.StdOut.flush ' End script