Collect Evidence
netcli.collect_evidence is a check step that runs CLI commands on each target device and captures every command's output as an evidence artifact. Use it to record device state — before-and-after snapshots, verification output, audit trails. It is meant for read-only show commands, but nothing enforces that: a configured command runs as written, so keep anything that changes device state in netcli.execute.
Using It
List the commands one per line, typically show/exec commands such as show version or show interfaces. Command lines accept {{ variable }} templates for flow inputs and earlier step results, resolved before the step runs. On each device all commands are executed together in one session, in order, and each command's output becomes its own artifact. Targets are chosen with the role-based target picker; there is no additional-IP list for this step.
Leaving the command list empty is not an error: as long as at least one target device is configured, the step succeeds with a "No commands configured" summary and collects nothing. Max Parallel Devices controls the fan-out: 1 (the default) processes devices strictly one after another, higher values run up to that many devices concurrently (capped at 32). Command output reaches the step's live log per device, once that device's whole command batch has finished.
Command timeout (30 seconds by default, at most 3600) limits how long one command may run on a device; a command that runs longer fails. Raise it for slow commands. The step's own timeout still applies to the whole step, so it must leave time for every command on every device.
SSH Compatibility
Allow legacy SSH algorithms defaults to off. Enable allow_legacy_ssh only for older devices which require weak algorithms or small host keys; it applies to the device and jump host for this step. Host-key verification still applies, and a failed secure connection never retries weakly. Prefer upgrading the device; use legacy mode only on a trusted network. The override enables only algorithms the selected transport library still supports.
To allow them for one old device in every step, set allow_legacy_ssh in the device's SSH access configuration instead (the jump host has its own flag). It covers that hop only and needs a Hegemony version that reads it.
Output
Later steps read what each device returned from the step's output: devices maps every device name to success, error (why it failed, or none) and commands, each command's output keyed by the command as configured, for example {{ steps.ID.output.devices['dlp1-edge-01'].commands['show running-config'] }}. Inventory names are unique per site only: a name two targets share is keyed as name (device id) for each of them. The output keeps at most 16 384 characters of one command and about 49 152 of the whole step, names included, and cuts a text only at the end of a line, so the platform's masking of secrets still sees each line whole. A text cut short is named in truncated as device:command; once the step's share is spent, the remaining devices keep success and error but no commands, and are named in omitted. The evidence always holds the whole text.
Each command on each device also yields a cli_output artifact named <device>:<command>, holding the raw output plus the device, the command, the exit code, and any error text. A device without a management host or one that fails to connect contributes an error artifact with the message instead. Metrics record device_count, command_count, total_success and total_failure (per-command results across devices), and failed_devices. The summary reports how many devices were collected from and how many commands succeeded.
When It Fails
The step fails when no target devices are configured, or when the commands value is malformed (not a list, or containing empty or non-string entries). Per device, it counts as failed when the device has no management host, when connecting or executing raises an error, or when any command returns a non-zero exit code. Collection continues on the remaining devices either way, and all collected evidence is kept — but if any device failed, the step fails and its error names each failing device with why it failed (its first failure). Devices that failed for the same reason are listed together before that reason, for example every device behind a jump host that refused the connection: Failed on: r1, r2 (reason); r3 (other reason). A command that runs past Command timeout counts as failed.