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:
8
snmp.go
8
snmp.go
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user