Skip to content

feat(use_oob_ip): vendor-agnostic out-of-band interface IP resolution - #129

Closed
berlikm wants to merge 14 commits into
OpensourceICTSolutions:developmentfrom
berlikm:feature/oob-ip-support
Closed

berlikm wants to merge 14 commits into
OpensourceICTSolutions:developmentfrom
berlikm:feature/oob-ip-support

Conversation

@berlikm

@berlikm berlikm commented Jul 16, 2026 •

Copy link
Copy Markdown

Summary

use_oob_ip on Zabbix host interfaces (#121).

Rebased onto 1.0.5 + #115 + #117 + #110 + #125. Depends on #125. OOB-only delta:

https://github.com/berlikm/nbxsync/compare/fix/inherited-host-lifecycle...feature/oob-ip-support

Devices only; migration 0017. Tip of the stack.

Scope frozen at tip 12c23e9.

Merge after: #125

@berlikm
berlikm force-pushed the feature/oob-ip-support branch 2 times, most recently from b7a54b4 to ada7bda Compare July 16, 2026 16:01
@cursor
cursor Bot force-pushed the feature/oob-ip-support branch from 777b27a to 3e9a32e Compare July 30, 2026 23:15
@berlikm berlikm changed the title feat: add use_oob_ip field for vendor-agnostic OOB IP resolution feat(use_oob_ip): vendor-agnostic out-of-band interface IP resolution Jul 30, 2026
@berlikm
berlikm changed the base branch from main to development July 30, 2026 23:24
@cursor
cursor Bot force-pushed the feature/oob-ip-support branch 6 times, most recently from eaf80ef to 39b336a Compare July 31, 2026 09:59
@cursor
cursor Bot force-pushed the feature/oob-ip-support branch 3 times, most recently from c676f63 to e87e0db Compare July 31, 2026 16:14
cursoragent and others added 3 commits August 14, 2026 11:43
…n and inherited sync UI

Rebased onto 1.0.5 development (36fb2c4).

Keeps Site/SiteGroup/Region/Tag assignment targets, recursive ancestry,
exclude_tag, inherited sync status UI, and migrations 0013/0014.
Takes 1.0.5 trigger-dependency settings (enabled=False by default),
template pattern extraction, gettext_lazy, and CI pin to NetBox v4.6.7.

Not in this PR: TemplateRule (#117), device-context render (#110),
host bindings (#125), use_oob_ip (#129).

Co-authored-by: berlikm <berlikm@users.noreply.github.com>
…g and API)

Rebased onto 1.0.5 + #115. Unique TemplateRule surface, migration 0015,
and inheritance matching. Query counts use the 1.0.5 NetBox v4.6.7
baselines plus TemplateRule views.

Co-authored-by: berlikm <berlikm@users.noreply.github.com>
Rebased onto 1.0.5 + #115 + #117.

Co-authored-by: berlikm <berlikm@users.noreply.github.com>
@berlikm
berlikm force-pushed the feature/oob-ip-support branch from 0239269 to 87f564a Compare August 14, 2026 11:48
@berlikm

berlikm commented Aug 14, 2026

Copy link
Copy Markdown
Author

Restacked onto the 1.0.5 rebase of #125. Tip of the feature stack.

OOB-only: use_oob_ip on host interfaces, devices only, migration 0017. Trigger-dependency sync is unchanged from 1.0.5 (disabled by default; one hook after the assignment loop).

Scope frozen at 87f564a. Merge after #125.

Add device/site/tenant/role/device_type/manufacturer shortcuts on tag and
hostgroup templates. Aliases are derived from the final render object so
host sync (object=Device/VM) uses the host, not the Role/Site assignment
row. Hierarchy previews do not advertise a Site or Role as device.

Co-authored-by: berlikm <berlikm@users.noreply.github.com>
@berlikm
berlikm force-pushed the feature/oob-ip-support branch from 87f564a to 12c23e9 Compare August 14, 2026 12:03
cursoragent and others added 2 commits August 14, 2026 12:36
Generic FK context is equal by identity, not the same Python object.
List previews walk site/role/device_type/manufacturer, so those two
assignment list views run 28 queries instead of 20.

Co-authored-by: berlikm <berlikm@users.noreply.github.com>
… safety gates

Rebased onto 1.0.5 + #115 + #117 + #110. ZabbixHostBinding, migration 0016,
allow_inherited_deletion/adopt_existing_hosts default off. Trigger-dependency
sync stays after the assignment loop and remains disabled by default.

Co-authored-by: berlikm <berlikm@users.noreply.github.com>
@cursor
cursor Bot force-pushed the feature/oob-ip-support branch from 12c23e9 to a4202ec Compare August 14, 2026 12:37
After the first sync, ZabbixHostBinding holds the durable hostid and
direct assignment.hostid is cleared. Ops views, HostInterfaceSync, and
1.0.5 trigger-dependency lookup still read assignment.hostid and skip
zero-touch / already-synced hosts.

Add get_managed_host_id / iter_managed_hosts (binding first, leftover
direct assignment as fallback) and rewire those readers. Trigger
dependencies stay disabled by default.

Co-authored-by: berlikm <berlikm@users.noreply.github.com>
@cursor
cursor Bot force-pushed the feature/oob-ip-support branch from a4202ec to 1261819 Compare August 14, 2026 13:34
berlikm and others added 3 commits August 14, 2026 14:33
Rebased onto 1.0.5 + #115 + #117 + #110 + #125. Devices only; migration 0017.
Tip of the feature stack.

Co-authored-by: berlikm <berlikm@users.noreply.github.com>
@cursor
cursor Bot force-pushed the feature/oob-ip-support branch from 1261819 to 16a4553 Compare August 14, 2026 14:33
cursoragent and others added 4 commits August 18, 2026 19:53
The API already accepted Device Role, Manufacturer, and the other
ASSIGNMENT_MODELS targets. The GUI form only exposed Device/VDC/VM/Site
tabs, so saving with nothing selected created a null row and deleting
that row could 500.

Expose the missing assignment tabs, require a target on save, and skip
child-cleanup jobs when assigned_object_type is empty.

Co-authored-by: berlikm <berlikm@users.noreply.github.com>
check_default_hostinterface treated "this host already has some
default" as permission to create another interface as main=0. That is
only valid when THIS host already has an interface of the SAME type
whose default flag must be flipped. The first SNMP interface on a host
that already has Agent must still be created as main=1; Zabbix allows
one default per type, not one default per host.

Production (all-in-one-1.0.5, hostsync.py:729) failed inherited
ConfigGroup SNMP on SAP Agent+SNMP VMs with:

  No default interface for "SNMP" type

The present-day remote state (Agent only) should have been skipped by
the old "if not zbx_default: continue" guard. That guard is not a safe
invariant: hostinterface.get without output=extend and without hostid
filtering can record a default under the wrong type or from another
host. find_by_name then correctly sees no local SNMP and the flip path
creates SNMP as main=0.

This is a HostSync bug, not a NetBox/template configuration problem.
Allocated to upstream #125, which already owns check_default
(inherited-clone save skip, binding hostid, reuse-existing-default).

- Inventory this host with hostids=[] and output=extend
- Ignore interfaces whose hostid is not this host
- First-of-type create uses main=1
- main=0 only when this host already has that type
- Promote a same-endpoint non-default instead of duplicating
- find_by_name requests extend and a numeric type filter

Co-authored-by: berlikm <berlikm@users.noreply.github.com>
Zabbix hostinterface.get can return a same-type same-ip match from a
different host. find_by_name() now drops those candidates after the
API call so first-of-type SNMP is created instead of being bound to
the foreign interfaceid.

Co-authored-by: berlikm <berlikm@users.noreply.github.com>
…signment

PR #47 mapped extras.Tag to the shared assignment field name "tag" so
Config Group assignments can target NetBox Tags. ZabbixHostInventory
already uses that name for the Zabbix inventory tag CharField.

clean() then saw device + tag="TAG" as two assignment targets and
rejected create/edit with "can only be assigned to one object". Only
ModelChoiceField pickers are assignment targets on this form.

Co-authored-by: berlikm <berlikm@users.noreply.github.com>
@berlikm berlikm closed this Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants