ecc-netmiko-ssh-automation

Automates SSH-based network device access with Python Netmiko for read-only collection and guarded config changes.

Updated Apr 18, 2025
One-click install
npx skills add https://github.com/adriancodes/dotfiles --skill ecc-netmiko-ssh-automation-adriancodes
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ecc-netmiko-ssh-automation
Source: https://github.com/adriancodes/dotfiles/tree/main/dot_agents/skills/ecc-netmiko-ssh-automation
Command: npx skills add https://github.com/adriancodes/dotfiles --skill ecc-netmiko-ssh-automation-adriancodes

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires netmiko.

What problem does it solve? Writing SSH automation for routers, switches, and firewalls is error-prone: hardcoded credentials, missing timeouts, unbounded concurrency, and accidental config pushes are common failure modes. This Skill provides reviewed Netmiko patterns that keep the default path read-only and gate any configuration change behind explicit operator approval. ## Core Features & Use Cases - Read-Only Connection Pattern: ConnectHandler setup with environment-based credentials, strict host key checking, and explicit connection, auth, banner, and read timeouts. - Batch Collection: ThreadPoolExecutor-based collection of show command output across an explicit inventory with per-device error reporting. - Structured Parsing: Optional TextFSM parsing with raw-output fallback so parser mismatches never hide evidence. - Guarded Config Changes: Dry-run-by-default config pushes requiring an explicit APPLY_NETWORK_CHANGES flag, with before/after evidence capture and a separate save step. - Use Case: An engineer needs to audit interface status across 30 switches. They use the batch collection pattern with max_workers=8, collect 'show ip interface brief' per device, and review failures individually without stopping the run. ## Quick Start Ask the assistant to write a Netmiko script that connects to a list of Cisco IOS devices and collects 'show version' output with proper timeouts and per-device error handling.

Frequently Asked Questions about ecc-netmiko-ssh-automation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I collect show command output from multiple Cisco devices with Netmiko?▼

Use ConnectHandler inside a ThreadPoolExecutor with a small max_workers value and an explicit device inventory. Wrap each connection in try/except for NetmikoAuthenticationException, NetmikoTimeoutException, and ReadTimeout so one failure does not stop the batch.

How to parse Netmiko command output with TextFSM?▼

Pass use_textfsm=True to send_command and set raise_parsing_error=False. If the result is still a string, no template matched, so keep the raw output alongside any parsed data for operator review.

How do I safely push config changes with Netmiko send_config_set?▼

Gate send_config_set behind an explicit operator flag such as an environment variable, defaulting to a dry run that prints candidate commands. Capture before and after state, and treat save_config as a separate approval step after verification.

Does Netmiko support concurrent SSH connections to network devices?▼

Yes, via ThreadPoolExecutor, but concurrency should stay low unless the device estate and AAA systems are known to handle the load. The reference pattern uses max_workers=8 with per-device error capture.

Why should credentials never be hardcoded in Netmiko scripts?▼

Hardcoded passwords, enable secrets, or private keys leak through source control, logs, and exception messages. Use environment variables, a vault, or getpass so credentials stay out of source and error output.

When should I avoid running Netmiko automation against a network?▼

Avoid sweeping CIDR ranges or running against unreviewed inventories, and never make config changes the default code path. Production changes require a change window, peer review, and a rollback plan.