Skip to content

CLI reference

Terminal window
python -m src [flags]
FlagDefaultDescription
--task NAMEGENERIC_TASKTask label recorded in inventory (e.g. SNMPV3, SYSLOG, BACKUP)
--commands NAMEnoneCommand file prefix to load (e.g. snmpv3{vendor}/snmpv3.txt)
--ip IPnoneSingle device IP — use with --vendor
--vendor VENDORciscocisco, cisco_wlc, wlc, nexus, alcatel, alcatel_wlc, aruba
--devices FILEconfig/devices.csvDevice CSV file
--alloffForce-load all of devices.csv, ignoring auto-retry
--retryoffRetry failed devices from config/failed_devices.csv
--role ROLEnoneFilter by role column. Exact match, comma-separate for multiple
--workers N1Parallel SSH connections
--backupoffSave full running-config per device to BACKUP/YYYY-MM/
--dry-runoffLoad and validate the device list without connecting
--validateoffValidate device list and command files — no SSH connections
--logoffEnable SSH session logging to LOGS/
--status-file FILEnoneUpdate Status column to Configured in a monitoring CSV
--retention DAYS30Backup retention in days (0 = keep all)
--format csv|jsoncsvSummary output format
FlagDefaultDescription
--discover-lldpoffVendor-neutral LLDP walk from devices already in inventory
--discover-cdpoffCisco-only CDP walk
--applyoffAppend newly found devices. Without it, dry-run print only
--output-devices FILE--devicesWrite discoveries here instead, keeping a read-only core inventory
--export-atlas FILEnoneAlso append discoveries in Atlas hosts-import CSV format
--role ROLEcoreWhich existing devices to run discovery against. Exact match
--vendor VENDORCDP: ciscoNarrow source devices by vendor. Substring match
--ip IPnoneSingle source device, for testing before a full run
FlagDefaultDescription
--discover SUBNETnoneScan one subnet, first three octets (e.g. 192.168.1)
--discover-alloffScan every subnet in config/discovery.csv
--diff-against FILEconfig/devices.csvCompare scan results against these CSVs. Comma-separate to merge
--capture-detailsoffSSH into responding hosts, pull hostname/serial/model
FlagDefaultDescription
--capture-core-stackoffPer-unit serial, model, OS version, uptime. One row per physical unit
--output-cores FILEcore_stack_info.csvOutput CSV path
--capture-syslogoffCapture current syslog server config to SYSLOG_CAPTURE/
FlagDescription
--health-checkSSH reachability check — no metrics, no config changes. Ignores --workers
--healthcheckCollect CPU/memory/virtual-chassis metrics, write CSV + HTML report to SUMMARY/
--notifySend the health report via enabled notification channels (email/Telegram)
--baseline VENDOR|NAMERun CIS-style compliance check against saved BACKUP/ configs
--report [FILE]Generate report from a SUMMARY CSV (omit FILE for latest)
--pattern TEXTWith --report, confirm a config line landed in PRE_CHECK/POST_CHECK
--consolidateMerge all SUMMARY CSVs into SUMMARY/CONSOLIDATED_SUMMARY.csv
--export FILEExport network_inventory.db to CSV
--diff FILE1 FILE2Compare two config files line by line

Each worker is one simultaneous SSH connection. Workers never share connections.

Workers10,000 devices @ 30 s each
1 (default)~83 hours
10~8.3 hours
20~4.2 hours
30~2.8 hours
50~1.7 hours

Start with --workers 20. Set a permanent default in config.yaml:

execution:
max_workers: 20
Terminal window
# Single device test
python -m src --task SNMPV3 --commands snmpv3 --ip 10.0.0.1 --vendor cisco
# Subset test before full rollout
python -m src --task SNMPV3 --commands snmpv3 --devices config/testdata_devices.csv
# Full rollout
python -m src --task SNMPV3 --commands snmpv3 --devices config/devices.csv --workers 20
# Retry failures
python -m src --task SNMPV3 --commands snmpv3 --retry --workers 10
# Backup all running-configs
python -m src --task BACKUP --commands backup --backup --devices config/devices.csv --workers 20
# Dry run — load and validate the device list without connecting
python -m src --task SNMPV3 --commands snmpv3 --devices config/devices.csv --dry-run
# Update monitoring CSV after successful run
python -m src --task SNMPV3 --commands snmpv3 --devices config/devices.csv --workers 20 --status-file data/dataswitches.csv