Assign collection profiles
When you need this
Section titled “When you need this”- “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.
Prerequisites
Section titled “Prerequisites”- 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.
Create a profile
Section titled “Create a profile”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:
docker compose run --rm reconciler l2trace profile create \ --name gateway --default-interval 300 \ --snmp-interval 120 --gnmi-interval 30Here 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.
Assign it to a device
Section titled “Assign it to a device”docker compose run --rm reconciler l2trace device assign-profile \ --hostname sw-core-1 --profile gatewayThe 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.)
See what’s defined
Section titled “See what’s defined”docker compose run --rm reconciler l2trace profile list| name | default(s) | snmp(s) | gnmi(s) | ssh(s) | description |
|---|---|---|---|---|---|
| desktop | 3600 | - | - | - | access closets, hourly |
| gateway | 300 | 120 | 30 | - | 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.
How the interval is resolved
Section titled “How the interval is resolved”For each (device, source) pair, the orchestrator walks four levels and
takes the first that’s set:
- Per-row override —
device_collector.extras['poll_interval_seconds']on that exact collector row. This is the escape hatch for “one weird device” and beats everything below it. - Profile per-source override —
--snmp-interval/--gnmi-interval/--ssh-intervalfrom the assigned profile. - Profile default —
--default-intervalfrom the assigned profile. - 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.
Clear an assignment
Section titled “Clear an assignment”docker compose run --rm reconciler l2trace device clear-profile \ --hostname sw-core-1The 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.
Deleting a profile
Section titled “Deleting a profile”docker compose run --rm reconciler l2trace profile delete --name gatewayDeleting 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.
See also
Section titled “See also”- 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
profileanddevicesubcommands