Skip to content
 
 

Repository files navigation

NetBox-Sync (custom fork)

Fork of bb-Ricardo/netbox-sync with extra automation: NetBox cables from ESXi CDP/LLDP neighbors.

Upstream install, config, sources, and pruning still apply. Details specific to this fork are in the next section.

Sources: VMware vCenter

Read the docs carefully before running. This tool writes to NetBox.


Fork feature: cables from ESXi CDP/LLDP

During VMware host sync, ESXi physical NICs (vmnic*) expose CDP/LLDP neighbor data (switch + port). Upstream mainly puts that into the interface description. This fork also creates NetBox cables when both ends already exist:

End Object
A ESXi interface (vmnic…)
B Switch interface (physical port)

Prerequisites (required):

  1. Switches already exist in NetBox (name = CDP/LLDP system name, or the same name without domain).
  2. Physical ports already exist on those switches.
  3. ESXi hosts and vmnic* interfaces exist (normal VMware sync).

No switch or switch port is created by the cable logic—match only.

Flow:

ESXi vmnic → QueryNetworkHint
  CDP:  systemName or devId (Device ID), portId
  LLDP: System Name, Port ID (+ Port Description)
       ↓
Match NetBox device (FQDN ↔ short name)
Match NetBox interface (long ↔ short port names)
       ↓
Create cable if both interface IDs exist

Port name aliases (examples): FastEthernetFa, GigabitEthernetGi, TenGigabitEthernetTe, TwentyFiveGigETwe/TF, XGigabitEthernetXGi.

Cable fields: status connected; type cat5 for FastEthernet/Fa…, else dac-active; description from port description when present; label {server_iface_id}:{switch_iface_id}.

Duplicates between the same two interfaces are skipped. New hosts may get cables on the next run once interface IDs exist in NetBox.

About

Sync objects from VMware to NetBox (Copy repo from bb-Ricardo for modificate)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages