← All projectsCASE STUDY / 07 · LINUX / INFRASTRUCTURE AUTOMATION

Proxmox inventory.Drift control with NetBox and Zabbix.

Designed and deployed an operational inventory workflow, from collecting hypervisor and VM configurations to reconciling them against NetBox and monitoring daily drift.

Proxmox VELinuxPythonNetBoxsystemdZabbixGitHub Actions
READ-ONLYScheduled discovery and audits without automatic infrastructure changes
0 DRIFTDifferences found during acceptance testing
RU / ENPublic, sanitized code and documentation
01 / CHALLENGE

A reliable inventory, not another spreadsheet.

Virtual machines, network adapters and cluster settings change continuously. Manual records become stale, while bulk synchronization mistakes can affect production. The goal was to maintain a usable NetBox inventory and detect changes without automatically pushing configuration updates.

02 / ARCHITECTURE

Separate discovery, inventory and verification.

Each component has a defined role, with read-only API access separate from privileged write operations.

01 / SOURCE

Proxmox VE

pvesh GET: nodes, QEMU/LXC guests, NICs and resources

02 / COLLECT

Python

Normalized inventory, completeness checks and private JSON snapshots

03 / INVENTORY

NetBox

DCIM and Virtualization: hosts, VMs and virtual NICs

04 / AUDIT

systemd

Separate daily physical-host and guest drift checks

05 / OBSERVE

Zabbix

CLEAN / DRIFT / ERROR, difference count and audit timestamp

03 / IMPLEMENTATION

From scripts to an operational workflow.

Host and VM discovery

Collect hypervisor hardware, QEMU/LXC guests, assigned CPU/RAM and virtual networking. Reconcile records against existing NetBox objects using stable identifiers.

Guarded import

Reviewable preview and dry-run, expected-count checks, a PostgreSQL backup, explicit confirmation and transactional interface creation. No automatic remediation.

Intentional exceptions

A stopped VM template may share a MAC with a live guest. The NIC is inventoried without assigning the conflicting address, and the exception is verified by the audit.

Drift monitoring

Separate systemd timers and report paths for hosts and guests, sanitized numeric export via Zabbix Agent, and triggers for drift, execution errors and stale data.

04 / OUTCOME

Auditable inventory rather than manual tracking.

The production NetBox inventory was verified against Proxmox for hosts, guests and network interfaces. End-to-end validation included Zabbix Server polling the exported values. The system detects drift; it is not a bidirectional infrastructure orchestrator.

  • Independent daily hardware and QEMU/LXC drift checks
  • Distinct CLEAN, DRIFT and ERROR states
  • Snapshot freshness and exception validation
  • Restricted file permissions, TLS and scoped read-only API credentials
  • Python tests and GitHub Actions CI checks
05 / SOURCE CODE

Engineering decisions backed by code.

The public repository includes collectors, auditors, systemd definitions, Zabbix integration, tests and operational documentation. Production addresses, internal hostnames, VMIDs and MACs are excluded.

Scope: inventory and drift detection. NetBox does not directly manage Proxmox configuration, and drift never triggers automatic changes. The code requires environment-specific configuration and validation before use in production.