Skip to content

Example: Pre/Post-Change Interface State Validation

Scenario: Validate that all Loopback interfaces are up before a change, then intentionally shut down a loopback interface, and use the app to detect and highlight the change.

Step 1: Create the "Loopback Interfaces Up" Check

  1. Navigate to: OperationsOperational ComplianceChecks Click the + button to create a new check.

  2. Fill in the form:

    • Name: Loopback Interfaces Up
    • Check Type: EXACT_MATCH
    • Check Type Options: (leave blank)
    • Description: Ensure all Loopback interfaces are up
    • Logging Severity: INFO
  3. Click: Create

Create a new check

Step 2: Create the Check Command for Loopback Interfaces

  1. Navigate to: OperationsOperational ComplianceCheck Commands Click the + button.

  2. Fill in the form:

    • Parser: TEXTFSM
    • Command: show interfaces
    • Check Object: Loopback Interfaces Up
    • Platform: cisco_ios
    • Value Path:
    [?starts_with(interface, 'Loopback')].[interface, link_status, protocol_status]
    

    (This JMESPath expression filters for interfaces whose name starts with "Loopback" and extracts their interface name, link status, and protocol status.)

  3. Click: Create

Step 3: Create a Check Group

  1. Navigate to: OperationsOperational ComplianceCheck Groups Click the + button.

  2. Fill in the form:

    • Name: Pre/Post Change Validation
    • Check Commands: Add the Loopback Interfaces Up check command
  3. Click: Create

Create a new check group

Step 4: Run a Collect Check (Pre-Change)

  1. Navigate to: OperationsOperational ComplianceCollect Checks. Click the + button.

  2. Fill in the form:

    • Check: Check: Loopback Interfaces Up
    • Devices: Select your device
  3. Click: Collect Checks

    Run collect check

  4. Navigate to the Collect Checks page and you can view the output of the check.

Step 5: Make a Change on the Device

SSH to your device and shut down a loopback interface:

conf t
interface Loopback10
shutdown
end

Step 6: Run a Collect Check (Post-Change)

Repeat Step 4 to collect the post-change state.

Step 7: Run a Compare Check

  1. Navigate to: OperationsOperational ComplianceCompare Checks Click the + button.

  2. Fill in the form:

    • Device: Select your device
    • Check: Loopback Interfaces Up
    • Collect Check 1: Select your pre-change collection
    • Collect Check 2: Select your post-change collection
  3. Click: Compare Checks

Compare check form

Example Data

Pre-Change (Loopback10 up):

[
  ["Loopback0", "up", "up"],
  ["Loopback10", "up", "up"],
  ["Loopback109", "up", "up"]
]

Post-Change (Loopback10 down):

[
  ["Loopback0", "up", "up"],
  ["Loopback10", "administratively down", "down"],
  ["Loopback109", "up", "up"]
]

Compare check results

Example Diff Output:

{
  "index_element[1][1]": {
    "new_value": "administratively down",
    "old_value": "up"
  },
  "index_element[1][2]": {
    "new_value": "down",
    "old_value": "up"
  }
}

How to read this diff:

  • index_element[1][1] means the second interface in the list (Loopback10), second field (link_status), changed from "up" to "administratively down".
  • index_element[1][2] means the second interface, third field (protocol_status), changed from "up" to "down".

This shows exactly which interface and fields changed between the two results.