Skip to content

Assign collection profiles

  • “The core routers need fast polling so we catch transient moves — but the access closets churn slowly and don’t justify the SNMP traffic. Same tool, two cadences.”
  • “This fabric is SNMP-constrained. I want to back off the poll interval on a whole class of devices without touching every row by hand.”
  • “We have one cadence policy — ‘gateway’, ‘desktop’, ‘core’ — and we want to reuse it across dozens of devices, then tune it in one place.”

A collection_profile is a named policy: a default poll interval plus optional per-source overrides for SNMP, gNMI, and SSH. Devices link to one profile (or none). The orchestrator resolves the effective interval per (device, source) pair at poll time, so the same profile gives gNMI and SNMP different cadences if you want.

  • At least one device registered — see Register a switch.
  • The reconciler container running (make up). The orchestrator inside it is what reads the profile and applies the interval; the CLI just writes the rows.
Terminal window
docker compose run --rm reconciler l2trace profile create \
--name gateway --default-interval 300 \
--description "core routers + gateways, fast poll"

That defines a gateway profile that polls every 300 seconds across every source. The command is idempotent on --name — re-running it with the same name updates the intervals and description in place rather than erroring.

To give one source a different cadence than the default, add a per-source override:

Terminal window
docker compose run --rm reconciler l2trace profile create \
--name gateway --default-interval 300 \
--snmp-interval 120 --gnmi-interval 30

Here the default is 300s, SNMP polls every 120s, gNMI streams-refresh every 30s, and SSH — which has no override — falls back to the 300s default. Intervals must be positive; a zero or negative value is rejected.

Terminal window
docker compose run --rm reconciler l2trace device assign-profile \
--hostname sw-core-1 --profile gateway

The assignment is keyed on hostname and profile name, both unique. If either the host or the profile name doesn’t exist, the command is a deliberate no-op — it prints a “no change” notice rather than silently clearing an existing assignment. (A typo’d profile name does NOT wipe the device’s current profile.)

Terminal window
docker compose run --rm reconciler l2trace profile list
namedefault(s)snmp(s)gnmi(s)ssh(s)description
desktop3600---access closets, hourly
gateway30012030-core routers + gateways, fast poll

A - in a per-source column means that source inherits the default. So desktop polls everything hourly; gateway overrides SNMP and gNMI and leaves SSH on its 300s default.

For each (device, source) pair, the orchestrator walks four levels and takes the first that’s set:

  1. Per-row overridedevice_collector.extras['poll_interval_seconds'] on that exact collector row. This is the escape hatch for “one weird device” and beats everything below it.
  2. Profile per-source override--snmp-interval / --gnmi-interval / --ssh-interval from the assigned profile.
  3. Profile default--default-interval from the assigned profile.
  4. Collector built-in default — if the device has no profile and no per-row override, no interval row is injected and the collector uses its own DEFAULT_POLL_INTERVAL_SECONDS.

So a per-row override always wins, a profile fills the gap for any device that has one assigned, and an unassigned device just runs the collector default. See Collection cadence for why the cadence matters against MAC aging and transient moves.

Terminal window
docker compose run --rm reconciler l2trace device clear-profile \
--hostname sw-core-1

The device’s collection_profile_id goes back to NULL and it falls back to the global default (level 4 above). If the device had no profile assigned, this is a no-op.

Terminal window
docker compose run --rm reconciler l2trace profile delete --name gateway

Deleting a profile doesn’t fail just because devices are using it. The foreign key is ON DELETE SET NULL, so every device currently assigned to gateway has its profile quietly reset to NULL and falls back to the global default. There’s no orphaned-reference state to clean up — but the devices DO change cadence the next time the orchestrator reconfigures, so delete with that in mind.

  • Collection cadence — why different device classes warrant different poll intervals, and how cadence trades off against catching transient MAC moves
  • Register a switch — get a device into the collection system before you assign a profile to it
  • CLI reference — every flag for profile and device subcommands