Learning paths › Automation › Netmiko, SCP and structured parsing
Netmiko, SCP and structured parsing
Netmiko past the basics — a pattern paired with each command, files put and got over SCP, the session logged for diagnosis, a with block that disconnects, an auth failure told from a timeout, and threading bounded by a pool — then structured parsing with TextFSM templates and Genie, the data formats around it in JSON, YAML and XML, configuration rendered from a Jinja template, and a closing stretch on MCP: a server built with three tools, used to configure a device, extended with a library, and then called from a Python client. Explanation and checks; three written exercises.
Lessons
- Pair each command with the pattern it expects
- Put and get files over SCP
- Fetch running and startup config by SCP
- Log the Netmiko session for diagnosis
- Disconnect automatically with a with block
- Tell an auth failure from a timeout
- Connect Netmiko with an SSH key
- Parse a send_command result with regex
- Collect from many devices on threads
- Bound the concurrency with a pool
- Get structured fields with TextFSM templates
- Parse show output with Genie
- Exchange data as JSON
- Keep inventories in YAML
- Navigate an XML reply as a dictionary
- Walk the same XML as an element tree
- Render configuration from a Jinja template
- Manage projects and dependencies with uv
- MCP: expose tools to a model over a protocol
- Build an MCP server with three tools
- Configure a Cisco device through MCP
- Add a third-party library to an MCP server
- Call your server from a Python MCP client
- Drive a browser through the Playwright MCP server
More in Automation
- First scripts that configure devices
- NAPALM: structured data across vendors
- Concurrency, and the Python types device output returns
- Parsing show output and testing conditions
- Readable code, branching and loops
- Build the workstation and the toolchain
- Files, CSV, JSON and pickle
- Paramiko: SSH to devices from Python
- Netmiko at fleet scale
- Tuples, sets and dictionaries for device records
- Exceptions and your first classes
- Plan and build the automation lab
- Files, formatting and regular expressions
- Addresses, functions, modules and classes
- CSV inventories, logging and scheduling
- Agents, async and model-driven workflows
- NETCONF, YANG and RESTCONF
- NX-API, pyATS and Genie
- A small GenAI app, end to end
- macOS, Linux and the virtual lab
- Agile delivery and Python fundamentals
- REST APIs, authentication and requests
- Flask, Docker and Jenkins
- Managing a router with NETCONF and RESTCONF
- Ansible: inventory, ad-hoc commands and first playbooks
- Roles and zero-touch provisioning for Linux switches
- Installing the controller and applying a project
- Setting up Python 3
- The Ansible lab and the controller
- Vault, variables and config changes
- Parsing output and knowing which variable wins
- Jinja filters and PAN-OS automation
- Loops, callbacks, strategy and run control
- Roles, imports and writing your own module
- Running playbooks from AWX