[ZBX-18982] windows network template problem Created: 2021 Feb 06  Updated: 2022 Jan 12  Resolved: 2022 Jan 12

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G), Agent2 plugin (G), Server (S)
Affects Version/s: 5.0.8
Fix Version/s: None

Type: Problem report Priority: Minor
Reporter: zlq Assignee: Zabbix Development Team
Resolution: Duplicate Votes: 1
Labels: templates
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Zabbix Server OS: CentOS 7.9.2009
Zabbix Client OS: Windows Server 2012 R2
Zabbix Server/Client version 5.0.8


Attachments: PNG File image-2021-02-06-10-43-41-967.png     PNG File image-2021-02-06-11-03-04-886.png     PNG File image-2021-02-09-14-23-15-534.png    
Issue Links:
Sub-task
part of ZBX-16803 LLD rule couldn't create items in tem... Closed

 Description   

 

Steps to reproduce:

  1. In "Template Module Windows network by Zabbix agent",  item "Network interfaces WMI get" ,  key "wmi.getall[root\cimv2,"select Name,Description,NetConnectionID,Speed,AdapterTypeId,NetConnectionStatus from win32_networkadapter where PhysicalAdapter=True and NetConnectionStatus>0"]
  2. My client is a HPE 380 Gen9 , and its network adapter is one adapter with four ports. So I get the following result:
  3. // code placeholder
    PS C:\Users\Administrator> Get-WmiObject -Namespace root\cimv2 -Query "select Name,Description,NetConnectionID,Speed,Ada
    pterTypeId,NetConnectionStatus from win32_networkadapter where PhysicalAdapter=True and NetConnectionStatus>0"
    __GENUS             : 2
    __CLASS             : Win32_NetworkAdapter
    __SUPERCLASS        :
    __DYNASTY           :
    __RELPATH           :
    __PROPERTY_COUNT    : 6
    __DERIVATION        : {}
    __SERVER            :
    __NAMESPACE         :
    __PATH              :
    AdapterTypeId       : 0
    Description         : HPE Ethernet 1Gb 4-port 331i Adapter
    Name                : HPE Ethernet 1Gb 4-port 331i Adapter
    NetConnectionID     : Embedded LOM 1 Port 1
    NetConnectionStatus : 2
    Speed               : 1000000000
    PSComputerName      :
    
    __GENUS             : 2
    __CLASS             : Win32_NetworkAdapter
    __SUPERCLASS        :
    __DYNASTY           :
    __RELPATH           :
    __PROPERTY_COUNT    : 6
    __DERIVATION        : {}
    __SERVER            :
    __NAMESPACE         :
    __PATH              :
    AdapterTypeId       :
    Description         : HPE Ethernet 1Gb 4-port 331i Adapter
    Name                : HPE Ethernet 1Gb 4-port 331i Adapter
    NetConnectionID     : Embedded LOM 1 Port 4
    NetConnectionStatus : 4
    Speed               :
    PSComputerName      :
    
    __GENUS             : 2
    __CLASS             : Win32_NetworkAdapter
    __SUPERCLASS        :
    __DYNASTY           :
    __RELPATH           :
    __PROPERTY_COUNT    : 6
    __DERIVATION        : {}
    __SERVER            :
    __NAMESPACE         :
    __PATH              :
    AdapterTypeId       :
    Description         : HPE Ethernet 1Gb 4-port 331i Adapter
    Name                : HPE Ethernet 1Gb 4-port 331i Adapter
    NetConnectionID     : Embedded LOM 1 Port 3
    NetConnectionStatus : 4
    Speed               :
    PSComputerName      :
    
    __GENUS             : 2
    __CLASS             : Win32_NetworkAdapter
    __SUPERCLASS        :
    __DYNASTY           :
    __RELPATH           :
    __PROPERTY_COUNT    : 6
    __DERIVATION        : {}
    __SERVER            :
    __NAMESPACE         :
    __PATH              :
    AdapterTypeId       :
    Description         : HPE Ethernet 1Gb 4-port 331i Adapter
    Name                : HPE Ethernet 1Gb 4-port 331i Adapter
    NetConnectionID     : Embedded LOM 1 Port 2
    NetConnectionStatus : 4
    Speed               :
    PSComputerName      :

Expected:

  1. From the result we find four ports have same name and description, and just connectionID is different. In the Discovery Rule, all item keys are identified by name. As a result three ports data are discarded and in host items just one port data  is showing


 Comments   
Comment by zlq [ 2021 Feb 06 ]

Comment by Aigars Kadikis [ 2021 Feb 09 ]

Thank you for registering this use case.

Not sure we can mark this as a bug. Why windows is allowing adapter names with the same name and same description?

As a workaround I can offer to modify preprocessing rule inside discovery section. Install additional field 'IFNETCONNECTIONID' to later mark item as unique:

output = JSON.parse(value).map(function(net){
    return {
        "{#IFNAME}": net.Name,
        "{#IFDESCR}": net.Description,
        "{#IFPHYSICALADAPTER}": net.PhysicalAdapter,
        "{#IFALIAS}" : net.NetConnectionID,
        "{#IFNETENABLED}": net.NetEnabled,
        "{#IFNETSTATUS}": net.NetConnectionStatus,
"{#IFNETCONNECTIONID}": net.NetConnectionID,
        "{#IFSPEED}": net.Speed
    }})
return JSON.stringify({"data": output})  

After that add in every item prototype:

There is a lot of item prototypes to modify!

Let us know if workaround helps.

Comment by zlq [ 2021 Feb 13 ]

Thank you for reply.

But I think this method only works well for dependent items. For zabbix agent items not work. 

The items for example net.if.in, net.if.out, cannot add additional params. And the results from the WMI query also cannot make the network interface name like "HPE Ethernet 1Gb 4-port 331i Adapter #3", which get from zabbix agent discovery item "net.if.discovery" and can successfully collect data.

Comment by Aigars Kadikis [ 2021 Feb 16 ]

Thank you for clearance with 'net.if.in' and 'net.if.out' agent keys. I agree with you, we do not have a solution yet to cover this situation with Zabbix agent.

Currently, 'net.if.in' and 'net.if.out' keys only accept one dimension for interface identification. The second argument is dedicated to the mode:

net.if.in["{#IFNAME}",<mode>]
net.if.out["{#IFNAME}",<mode>]

I think a fast patch would be to have a third argument for 'NetConnectionID'.

Comment by Aigars Kadikis [ 2021 Feb 16 ]

Confirming problem.

Additional use case occurred with another client. Here is discovery data:

[
  {
    "Description": "Broadcom NetXtreme Gigabit Ethernet",
    "Name": "Broadcom NetXtreme Gigabit Ethernet",
    "NetConnectionID": "NIC1",
    "NetConnectionStatus": 4
  },
  {
    "Description": "Broadcom NetXtreme Gigabit Ethernet",
    "Name": "Broadcom NetXtreme Gigabit Ethernet",
    "NetConnectionID": "NIC4",
    "NetConnectionStatus": 4
  },
  {
    "Description": "Broadcom NetXtreme Gigabit Ethernet",
    "Name": "Broadcom NetXtreme Gigabit Ethernet",
    "NetConnectionID": "NIC2",
    "NetConnectionStatus": 4
  },
  {
    "Description": "Broadcom NetXtreme Gigabit Ethernet",
    "Name": "Broadcom NetXtreme Gigabit Ethernet",
    "NetConnectionID": "NIC3",
    "NetConnectionStatus": 4
  },
  {
    "AdapterTypeId": 0,
    "Description": "QLogic BCM57810 10 Gigabit Ethernet (NDIS VBD Client)",
    "Name": "QLogic BCM57810 10 Gigabit Ethernet (NDIS VBD Client)",
    "NetConnectionID": "SLOT 4 2 Port 2",
    "NetConnectionStatus": 2,
    "Speed": "10000000000"
  },
  {
    "Description": "QLogic BCM57810 10 Gigabit Ethernet (NDIS VBD Client)",
    "Name": "QLogic BCM57810 10 Gigabit Ethernet (NDIS VBD Client)",
    "NetConnectionID": "SLOT 4 2 Port 1",
    "NetConnectionStatus": 4
  }
] 
Comment by Mike [ 2021 Jun 06 ]

I have the same problem on many hosts and none of the many versions of agent updates have fixed it yet.

Comment by Michael Veksler [ 2022 Jan 12 ]

Closed as duplicate of ZBX-19686

Generated at Sat May 03 06:47:07 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.