merge snmp-discovered interfaces with existing node found by ip

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Ian Gulliver
2026-01-18 14:23:21 -08:00
parent 6d50ee30aa
commit 8cb605b817
2 changed files with 13 additions and 0 deletions

View File

@@ -207,6 +207,14 @@ func (t *Tendrils) queryInterfaceMACs(snmp *gosnmp.GoSNMP, deviceIP net.IP) {
t.nodes.Update(iface.mac, nil, iface.name, "", "snmp-ifmac")
macs = append(macs, iface.mac)
}
existingNode := t.nodes.GetByIP(deviceIP)
if existingNode != nil {
for _, iface := range existingNode.Interfaces {
macs = append(macs, iface.MAC)
}
}
if len(macs) > 1 {
t.nodes.Merge(macs, "snmp-ifmac")
}