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 <
[email protected]>
' 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 "<module>"
Wscript.StdOut.WriteLine " <name><![CDATA[Network_Usage_Bytes]]></name>"
Wscript.StdOut.WriteLine " <description><![CDATA[Total network usage in bytes]]></description>"
Wscript.StdOut.WriteLine " <unit>bytes/sec</unit>"
Wscript.StdOut.WriteLine " <type>generic_data_inc</type>"
Wscript.StdOut.WriteLine " <data><![CDATA[" & BytesSUM & "]]></data>"
Wscript.StdOut.WriteLine "</module>"
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.