Skip to content

Commit

Permalink
Amend getting the local interface DD ID for topology
Browse files Browse the repository at this point in the history
  • Loading branch information
zoedt committed Oct 30, 2024
1 parent 8ec468e commit 71138f9
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion cisco_aci/datadog_checks/cisco_aci/ndm.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def create_topology_link_metadata(lldp_adj_eps, cdp_adj_eps, device_map, namespa
lldp_adj_ep = LldpAdjEp(**lldp_adj_ep.get("lldpAdjEp", {}))

local_device_id = device_map.get(lldp_adj_ep.attributes.local_device_dn)
local_interface_id = "{}:{}".format(local_device_id, lldp_adj_ep.attributes.local_port_index)
local_interface_id = "{}:{}".format(local_device_id, lldp_adj_ep.attributes.local_port_id)

remote_entry_unique_id = "{}.{}".format(
lldp_adj_ep.attributes.local_port_index, lldp_adj_ep.attributes.remote_port_index
Expand Down Expand Up @@ -114,7 +114,19 @@ def create_topology_link_metadata(lldp_adj_eps, cdp_adj_eps, device_map, namespa
)


def get_interface_dd_id(device_id: str, port_id: str) -> str:
"""
Create the interface DD ID based off of the device DD ID and port ID
ex: default:10.0.200.1:cisco_aci-eth1/1
"""
return '{}:cisco_aci-{}'.format(device_id, port_id)


def get_device_ip_mapping(devices):
"""
Create a mapping of node ID to device ID
ex: pod-1-node-1 -> default:10.100.0.1
"""
devices_map = {}
for device in devices:
key = device.pod_node_id
Expand Down

0 comments on commit 71138f9

Please sign in to comment.