Skip to content

Getting Started with the App

This guide walks you through the complete workflow of the Operational Compliance app using the Nautobot UI. By the end, you will have created a validation rule, collected device state before and after a change, and compared the results to see what changed.

Prerequisites

Before starting, make sure you have:

Step 1: Create a Validation Rule

A Validation Rule defines what you want to check and how to compare the before/after data.

  1. Navigate to Operations > Setup > Validation Rules
  2. Click the + Add Validation Rule button to create a new rule
  3. Fill in the form:
    • Name: Device Facts
    • Rule Type: EXACT_MATCH
    • Rule Options: (leave null for EXACT_MATCH)
    • Description: Verify device facts remain unchanged
  4. Click Create

Tip

Start with EXACT_MATCH — it's the simplest rule type and will flag any difference at all between the before and after data. You can explore other rule types like TOLERANCE or PARAMETER_MATCH later. See the Rule Types Reference for details.

Step 2: Create a Command Parser

A Command Parser tells the app how to collect data for your rule on a specific platform. You need one Command Parser per platform.

  1. Navigate to Operations > Setup > Command Parsers
  2. Click the + Add Command Parser button
  3. Fill in the form:
    • Parser: NAPALM
    • Command: (leave blank — not used for NAPALM)
    • NAPALM Getter: get_facts
    • Validation Rule: Device Facts
    • Platform: Select your device's platform (e.g., cisco_ios)
    • Path: * (this captures the entire output)
    • Exclude: (leave empty list)
  4. Click Create

Note

The Parser field determines how the app collects and structures the data. When using NAPALM, you select a getter from the NAPALM Getter dropdown (e.g., get_facts, get_interfaces). When using TEXTFSM, TTP, or JSON, you enter the CLI command in the Command field instead (e.g., show interfaces). See the Command Parser Reference for a full explanation of each parser type.

Step 3: Create a Validation Rule Group

A Validation Rule Group bundles one or more rules together so you can run them all in a single job. This step is optional but recommended — it makes it easy to run the same set of checks consistently.

  1. Navigate to Operations > Setup > Validation Rule Groups
  2. Click the + Add Validation Rule Group button
  3. Fill in the form:
    • Name: Getting Started Checks
    • Description: Initial validation rules for testing the app
    • Validation Rules: Select Device Facts
  4. Click Create

Step 4: Take a "Pre" Snapshot

Now that the rules are configured, collect the current state of your devices by running the Take Snapshot job.

  1. Navigate to Operations > Manage > Snapshots and click the Take Snapshot button

    Tip

    You can also find this job under Jobs > Operational Compliance > Take Snapshot.

  2. Fill in the form:

    • Snapshot Name: Pre-Change (optional — a name will be auto-generated if left blank)
    • Validation Rule Groups: Select Getting Started Checks
    • Device: Select the device(s) you want to check

    Tip

    You can filter devices by location, platform, role, tags, and more. You can also select individual Validation Rules instead of (or in addition to) Validation Rule Groups.

  3. Click Run Job

  4. Wait for the job to complete. You should see your new snapshot in the Snapshots list.

Step 5: Make a Change

Make a change on your device. For this getting started example, any change will do — even something as simple as updating a description on an interface. The goal is to have something different when we collect data again.

conf t
interface Loopback0
description Changed by Operational Compliance test
end

Step 6: Take a "Post" Snapshot

Repeat Step 4 to collect the device state after your change:

  1. Navigate to Operations > Manage > Snapshots and click the Take Snapshot button
  2. Fill in the form:
    • Snapshot Name: Post-Change
    • Validation Rule Groups: Select Getting Started Checks
    • Device: Select the same device(s)
  3. Click Run Job

Step 7: Compare the Snapshots

Now compare the two snapshots to see what changed:

  1. Navigate to Operations > Manage > Validation Results and click the Compare Snapshots button

    Tip

    You can also find this job under Jobs > Operational Compliance > Compare Snapshots.

  2. Fill in the form:

    • Pre Snapshot: Select your "pre" snapshot (e.g., Pre-Change)
    • Post Snapshot: Select your "post" snapshot (e.g., Post-Change)
  3. Click Run Job

Step 8: View the Results

  1. Navigate to Operations > Manage > Validation Results
  2. The Compare Snapshots job creates one result per device, per validation rule. For example, if you compared snapshots that covered 3 devices and 2 rules, you would see 6 results — one for each combination.
  3. Each row in the table shows:
    • Device — which device was checked
    • Validation Rule — which rule was applied
    • Pre Snapshot / Post Snapshot — the two snapshots that were compared
    • Match — the pass/fail verdict:
      • Pass (green check): The "pre" and "post" data matched according to the rule
      • Fail (red X): Something changed that the rule flagged
  4. Click into a result to see the full detail page, including the diff showing exactly what changed

What's Next?

Advanced: Bootstrapping Rules via Script

If you prefer to create rules programmatically (e.g., for bulk setup or CI/CD pipelines), you can use the Nautobot shell or a script:

from nautobot_operational_compliance.models import (
    ValidationRule, CommandParser, ValidationRuleGroup,
    ValidationRuleTypeChoices, ParserTypeChoices,
)
from nautobot.dcim.models import Platform

# Create a validation rule
rule, _ = ValidationRule.objects.get_or_create(
    name="Device Facts",
    defaults={
        "rule_type": ValidationRuleTypeChoices.EXACT_MATCH,
        "description": "Verify device facts remain unchanged",
    },
)

# Create a command parser for Cisco IOS
CommandParser.objects.get_or_create(
    validation_rule=rule,
    platform=Platform.objects.get(name="cisco_ios"),
    defaults={
        "parser": ParserTypeChoices.NAPALM,
        "command": "get_facts",
        "path": "*",
    },
)

# Create a validation rule group
group, _ = ValidationRuleGroup.objects.get_or_create(
    name="Getting Started Checks",
    defaults={"description": "Initial validation rules"},
)
group.validation_rules.add(rule)

You will still need to run the Take Snapshot and Compare Snapshots jobs to collect and compare data — these can also be triggered via the REST API.