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:
- The app installed and configured
- At least one device in Nautobot with a Platform assigned (e.g.,
cisco_ios) - The Nautobot Nornir Plugin configured so Nautobot can connect to your devices
Step 1: Create a Validation Rule¶
A Validation Rule defines what you want to check and how to compare the before/after data.
- Navigate to Operations > Setup > Validation Rules
- Click the + Add Validation Rule button to create a new rule
- Fill in the form:
- Name:
Device Facts - Rule Type:
EXACT_MATCH - Rule Options: (leave null for EXACT_MATCH)
- Description:
Verify device facts remain unchanged
- Name:
- 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.
- Navigate to Operations > Setup > Command Parsers
- Click the + Add Command Parser button
- 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)
- Parser:
- 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.
- Navigate to Operations > Setup > Validation Rule Groups
- Click the + Add Validation Rule Group button
- Fill in the form:
- Name:
Getting Started Checks - Description:
Initial validation rules for testing the app - Validation Rules: Select
Device Facts
- Name:
- 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.
-
Navigate to Operations > Manage > Snapshots and click the Take Snapshot button
Tip
You can also find this job under Jobs > Operational Compliance > Take Snapshot.
-
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.
- Snapshot Name:
-
Click Run Job
- 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.
Step 6: Take a "Post" Snapshot¶
Repeat Step 4 to collect the device state after your change:
- Navigate to Operations > Manage > Snapshots and click the Take Snapshot button
- Fill in the form:
- Snapshot Name:
Post-Change - Validation Rule Groups: Select
Getting Started Checks - Device: Select the same device(s)
- Snapshot Name:
- Click Run Job
Step 7: Compare the Snapshots¶
Now compare the two snapshots to see what changed:
-
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.
-
Fill in the form:
- Pre Snapshot: Select your "pre" snapshot (e.g.,
Pre-Change) - Post Snapshot: Select your "post" snapshot (e.g.,
Post-Change)
- Pre Snapshot: Select your "pre" snapshot (e.g.,
- Click Run Job
Step 8: View the Results¶
- Navigate to Operations > Manage > Validation Results
- 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.
- 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
- Click into a result to see the full detail page, including the diff showing exactly what changed
What's Next?¶
- Walk through a more detailed scenario in the Use Cases guide
- Learn about JMESPath expressions and parser configuration in the Command Parser Reference
- Explore advanced rule types and comparison options in the Rule Types Reference
- Set up custom parser templates via Git in the Datasource Reference
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.