Network State Collection
Cheat sheet · https://pcornel.dk/topic.php?topic=5601
Answer
Network state collection gathers operational facts — interfaces, neighbours, routes, sessions, counters — from devices on a schedule or around a change, turns the output into structured data, and stores it with a timestamp.
Remember
Structured data beats screen text: use APIs, NETCONF or a parser rather than matching lines. Collect the same things the same way each time, or comparisons mislead. Timestamps must come from synchronised clocks.
First checks
ansible <dev> -m cisco.ios.ios_facts -a 'gather_subset=all'— factspyats learn ospf --testbed-file tb.yaml --output out/— learn state- Streaming telemetry (gNMI) — continuous state
Verify in this order
devices → state collection → structured snapshots
Where it usually breaks
Collected network state proves observations from specific sources at specific times; it does not alone prove topology-wide causation or current end-to-end reachability.
Configuration/input → graph/state refresh → plan → provider API request → provider terminal result → resource read-back → effective service state → workload.
Network State Collection Network Automation proof-boundary map
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Intent / scope | Source revision and exact targets are explicit | Stale inventory, hidden selector or wrong variables change scope |
| Management operation | Transport/model/payload and per-device response are traceable | Auth/capability/parser differences hide partial or wrong execution |
| Device state | Effective and persistent state are read back | Accepted config/API result is mistaken for convergence |
| Network proof | Original control/data-plane or service test passes | Automation summary substitutes for actual network acceptance |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5601