Navigation

  • index
  • modules |
  • next |
  • previous |
  • ciscoconfparse 1.8.0 documentation »
  • CiscoConfParse Tutorial

CiscoConfParse Tutorial¶

This tutorial will cover the features that most CiscoConfParse users care about. We make a couple of assumptions throughout this tutorial…

  • You already know Python

  • You (naturally) have a basic understanding of Cisco IOS

Contents:

  • CiscoConfParse Fundamentals: Using Parent / Child Relationships
    • IOS Parent-child relationships
    • IOSCfgLine objects
      • Example: Retrieving text from an IOSCfgLine object
    • Baseline configuration for these examples
    • Example Usage: Finding interface names that match a substring
    • Example Usage: Finding parents with a specific child
      • Method 1: for-loop to iterate over objects and search children
      • Method 2: list-comprehension to iterate over objects and search children
      • Method 3: find_objects_w_child()
    • Example Usage: Finding parents without a specific child
  • Getting Config Values with CiscoConfParse
    • re_match_typed(): Get a value from an object
    • re_match_iter_typed(): Iterate over all children and get a value
    • Getting multiple values from an interface with re_match_typed()
  • Example Usage: A Contrived Configuration Audit
  • Example Usage: Build configuration diffs
    • Baseline Configuration
    • Diff Script

Previous topic

CiscoConfParse Installation and Python Basics

Next topic

CiscoConfParse Fundamentals: Using Parent / Child Relationships

This Page

  • Show Source

Quick search

Navigation

  • index
  • modules |
  • next |
  • previous |
  • ciscoconfparse 1.8.0 documentation »
  • CiscoConfParse Tutorial
© Copyright 2007-2023, David Michael Pennington <mike /at\ pennington [dot] net>. Last updated on Jun 21, 2023. Created using Sphinx 6.1.3.