Skip to main content

Detect simulated OSPF changes using Invariant

To detect changes in simulated OSPF sessions between two network snapshots, fetch the ospf_session_compatibility report for each snapshot and compare them.

First, retrieve the report for your current snapshot. Replace <current_snapshot_uuid> with the actual snapshot ID.

invariant show ospf_session_compatibility --snapshot <current_snapshot_uuid> --json > current_ospf_sessions.json

Next, retrieve the report for the previous or baseline snapshot. Replace <previous_snapshot_uuid> with its ID.

invariant show ospf_session_compatibility --snapshot <previous_snapshot_uuid> --json > previous_ospf_sessions.json

Use a diff tool to compare the two files. Changes in the Session_Status field indicate differences in OSPF session establishment between the snapshots.

diff current_ospf_sessions.json previous_ospf_sessions.json
# Example output might show a change in session status:
# < "Interface": "core-1[GigabitEthernet0/0]",
# < "Session_Status": "OSPF_SESSION_ESTABLISHED",
# ---
# > "Interface": "core-1[GigabitEthernet0/0]",
# > "Session_Status": "NO_SESSION", # Example change

See Output > OSPF > ospf_session_compatibility for report details.