Hello, I would like to know if anyone knows how to monitor traffic network card ( download and upload ) on a Windows client computer. I tried several options but without success. Thank you very much.
Module for network traffic
abel · 28 jun 2016, 2:14 · 4 mensajes · 61 visitas
- Inicio del debate
Hi Abel, Sure. If you take a look on nettraffic.vbs plugin you can modify the code to get detailed information per interface: ' 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 & "RootCIMV2") 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 This code get all the traffic from all the interfaces and put all together. In a specific system you can get the information on WMI token "Win32_PerfRawData_Tcpip_NetworkInterface" it returns, totalbytes, send and received in three diferent variables: uint32 BytesReceivedPerSec; uint32 BytesSentPerSec; uint64 BytesTotalPerSec; This script could be modified to return two modules, one per input and other for output, and/or get only data from one interface.
I run the script that you uploaded in http://library.pandorafms.com/index.php?sec=Library&sec2=repository&lng=es&action=view\_PUI&id\_PUI=617 and no problems on the client computer . When you insert the plug- in configuration file and restart the agent I do not see the module in pandora . In the log file does not throw me any problem. what am I doing wrong?. this is the line in pandora.conf module_plugin cscript //B "%PROGRAMFILES%Pandora_Agent utilnic_traffic.vbs" Trank you very much.
This module returns a generic_data_inc value, this means you need at least two executions to show a value, because it shows the delta (the different between first execution and second), have you waited to see the second execution ? If not, set the agent in debug mode, and put here the XML file to see what happen.
I run the script that you uploaded in http://library.pandorafms.com/index.php?sec=Library&sec2=repository&lng=es&action=view\_PUI&id\_PUI=617 and no problems on the client computer . When you insert the plug- in configuration file and restart the agent I do not see the module in pandora . In the log file does not throw me any problem. what am I doing wrong?. this is the line in pandora.conf module_plugin cscript //B "%PROGRAMFILES%Pandora_Agent utilnic_traffic.vbs" Trank you very much.
Entra en tu cuenta para publicar.
