feat: add use_oob_ip field for vendor-agnostic OOB IP resolution#129
Open
berlikm wants to merge 21 commits into
Open
feat: add use_oob_ip field for vendor-agnostic OOB IP resolution#129berlikm wants to merge 21 commits into
berlikm wants to merge 21 commits into
Conversation
added configuration options
fix for netbox 4.6
…ions/main Merge main to development
…rt of a ProxyGroup , removed duplicate line, Fixed typo ( vs ) in ProxySync ([OpensourceICTSolutions#91])
…ions/test Trigger fix
Update pydantic dependency version constraints
…NTHLY timeperiods
Allow configuring a custom hostname and displayname for Zabbix
berlikm
force-pushed
the
feature/oob-ip-support
branch
from
July 16, 2026 14:56
370b65c to
b7a54b4
Compare
Add a 'use_oob_ip' boolean field to ZabbixHostInterface that, when
enabled, resolves the interface IP from the device's canonical NetBox
'oob_ip' field instead of primary_ip4.
Design:
- New BooleanField 'use_oob_ip' on ZabbixHostInterface (default False)
- Migration 0013_zabbixhostinterface_use_oob_ip
- In HostInterfaceSync.get_create_params(), when use_oob_ip=True and
no static IP is set, resolve from instance.oob_ip
- If the device has no oob_ip, return {} to skip interface creation
(no useless empty-IP interfaces in Zabbix)
- clean() updated to allow no static IP when use_oob_ip is enabled
Why oob_ip over mgmt_only interface matching:
- oob_ip is NetBox's canonical first-class field for OOB management
(Device.oob_ip, since NetBox 3.5)
- Always one value, no ambiguity, no picking logic
- Vendor-agnostic: works for iDRAC, iLO, BMC, Cisco CIMC, Supermicro IPMI
- VMs don't have oob_ip — feature is device-only by nature
Usage:
1. Create ZabbixHostInterface with type=SNMP, use_oob_ip=True, assigned
at Manufacturer level (e.g. 'Dell')
2. During sync, Dell servers WITH oob_ip get SNMP interface on OOB IP
3. Dell servers WITHOUT oob_ip skip the interface entirely ({})
4. Non-Dell devices unaffected (interface not inherited)
When a ZabbixHostInterface has use_oob_ip=True but the device being synced has no oob_ip, the interface type must be excluded from get_hostinterface_types(). Otherwise, the iDRAC SNMP template (requirement: SNMP interface type=2) passes the interface check and gets linked to VMs that have no actual SNMP interface. Flow: - VM (no oob_ip) inherits Dell Manufacturer iDRAC interface (use_oob_ip=True) - get_hostinterface_types() skips it → SNMP type not in list - get_template_attributes() sees no SNMP → iDRAC template requirement fails - Template not linked → no conflict with agent template Dell ESXi host (has oob_ip): - Interface not skipped → SNMP type in list - iDRAC template passes check → linked correctly
berlikm
force-pushed
the
feature/oob-ip-support
branch
from
July 16, 2026 16:01
b7a54b4 to
ada7bda
Compare
When use_oob_ip=True but the device has no oob_ip, get_create_params()
returns {} to signal that the interface should be skipped. Without this
guard, try_create() would call the Zabbix API with no parameters,
causing 'bool object is not subscriptable' errors.
Replace the per-method filtering in get_hostinterface_types() with a single filter point in sync_host(). After get_assigned_zabbixobjects() returns, immediately remove any interface with use_oob_ip=True when the device has no oob_ip. This fixes all downstream consumers simultaneously: - get_hostinterface_types() → no SNMP type for VMs → iDRAC template not linked - get_snmp_macros() → no OOB SNMP credentials pushed - get_hostinterface_attributes() → no TLS/IPMI from OOB interface - hostinterface sort loop → no 'IP cannot be empty' errors 3 lines in one place instead of patching 4 methods.
The migration was applied to the DB on the NetBox VM but the .py file was lost during a git reset (only the .pyc survived in __pycache__). This caused Django to not recognize the use_oob_ip column, breaking ORM-based ZabbixHostInterface creation with a NotNullViolation.
berlikm
added a commit
to berlikm/nbxsync
that referenced
this pull request
Jul 17, 2026
…ng migration fix) Merges the completed feature/oob-ip-support branch including the missing 0017 migration. Resolves conflicts in hostinterfacesync.py (merged oob_ip + primary_ip4 fallback paths) and syncbase.py (kept early-return-on-empty-params from oob branch + _should_persist guard from integration-test). Removed duplicate 0013 migration (kept 0017 which is already applied to the DB).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a
use_oob_ipboolean field toZabbixHostInterfacethat, when enabled, resolves the interface IP from the device's canonical NetBoxoob_ipfield instead ofprimary_ip4.Motivation
Physical servers (Dell, HP, Supermicro) have two independent network interfaces:
primary_ip4oob_ipThis patch lets nbxsync automatically create a second SNMP interface on the same Zabbix host, using the OOB IP for hardware-level monitoring (fans, temperature, power supply, disk health).
Design
use_oob_iponZabbixHostInterface(defaultFalse)0013_zabbixhostinterface_use_oob_ipHostInterfaceSync.get_create_params(): whenuse_oob_ip=Trueand no static IP is set, resolve frominstance.oob_ipoob_ip: return{}to skip interface creation (no useless empty-IP interfaces in Zabbix)clean()updated to allow no static IP whenuse_oob_ipis enabledWhy
oob_ipovermgmt_onlyinterface matchingoob_ipis NetBox's canonical first-class field for OOB management (since NetBox 3.5)oob_ipsetoob_ip— this feature is device-only by natureUsage
Dell iDRAC by SNMP) into ZabbixZabbixHostInterfacewithtype=SNMP,use_oob_ip=True, assigned at Manufacturer level (e.g.Dell)oob_ip→ SNMP interface created on OOB IPoob_ip→ interface skipped entirely (no noise)Files changed
nbxsync/models/zabbixhostinterface.py— new field + clean() validation (2 changed lines)nbxsync/utils/sync/hostinterfacesync.py— 10 lines inget_create_params()nbxsync/migrations/0013_zabbixhostinterface_use_oob_ip.py— new migrationMigration note
On the upstream
mainbranch, the last migration is0012. This PR adds0013— the correct next number. If the upstream has merged other migrations by the time this is reviewed, the number can be adjusted during rebase.