Skip to content

Have Mactrack use Cacti sites instead #152

Description

@jdcoats

Goal

Use Cacti core sites as MacTrack’s canonical site identity so operators create, rename, disable, and locate a physical site once.

MacTrack currently maintains a separate mac_track_sites identity table while Cacti devices use host.site_id -> sites.id. That duplicates administration and allows the two inventories to drift.

Architecture

  • Make sites.id the site identifier used by MacTrack devices and filters.
  • Retain MacTrack-only configuration in a one-to-one extension table keyed by sites.id (contacts, VLAN scan/skip policy, and deliberately cached operational summaries).
  • Route site reads and mutations through a focused service used by pages, CLI, poller, imports, and scheduled jobs.
  • Keep standalone MacTrack devices supported; they may reference a Cacti site without requiring a linked Cacti host.
  • Define explicit behavior for disabled/deleted sites and prevent silent orphaning.

Migration and compatibility

  • Ship an opt-in, transactional migration first.
  • Inventory existing Cacti and MacTrack sites before mutation.
  • Auto-map only unambiguous normalized-name matches.
  • Create core sites for unambiguous MacTrack-only records.
  • Require explicit operator mapping for collisions or duplicate names.
  • Rewrite all MacTrack site foreign keys atomically and retain an auditable old-to-new mapping.
  • Keep a read-compatible legacy layer for one release; do not support dual writes.
  • Provide preflight, dry-run, apply, verify, and rollback-safe failure handling.

Production-level acceptance

  • Install the plugin into a real Cacti tree with MariaDB.
  • Seed Cacti-only, MacTrack-only, matching, duplicate, disabled, and unmapped sites.
  • Run the actual migration command and verify database constraints and mappings.
  • Invoke the real MacTrack poller/scanner against an SNMP fixture after migration.
  • Verify UI filters, CLI/import paths, standalone devices, reports, and site deletion/disable behavior.
  • Require 100% line and branch coverage for all new migration/service code.

Related issues

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions