My goal is to add collect more information on the connected network interfaces (like MAC address, IP, Gateway, etc.) and found the Network interfaces discovery to be the right place to add my custom prototype items.
I have created a prototype item there like this:
Name: Interface {#IFNAME}({#IFALIAS}): MAC address
Zbx agent active
Key: wmi.getall[root\cimv2,"select MACAddress from win32_networkadapter where InterfaceIndex={#IFINDEX}"]
Type: Text
For this, I need the interface's index marked as IFINDEX. I have added that to the Preprocessing JavaScript like this:
I did not modify the Filter section.
This solution does not work.
Is there a way to include the interface index like so? Or is there a better solution for this type of prototype expansion?
I have created a prototype item there like this:
Name: Interface {#IFNAME}({#IFALIAS}): MAC address
Zbx agent active
Key: wmi.getall[root\cimv2,"select MACAddress from win32_networkadapter where InterfaceIndex={#IFINDEX}"]
Type: Text
For this, I need the interface's index marked as IFINDEX. I have added that to the Preprocessing JavaScript like this:
Code:
[...]
"{#IFSPEED}": net.Speed,
"{#IFINDEX}": net.InterfaceIndex
[...]
This solution does not work.
Is there a way to include the interface index like so? Or is there a better solution for this type of prototype expansion?