The Pivot: Transitioning from Manual CLI Engineer to Python Automation
The moment I realized typing 'configure terminal' on 50 switches manually was data entry, and how learning Python Netmiko transformed my engineering career.
“I spent four hours on a Saturday night manually logging into 40 Cisco switches via PuTTY to change a single NTP server IP address. On switch 36, fatigue caused a typo that broke database clock synchronization. I swore I would never type manual CLI commands across multiple switches again.”
In early 2017, during my tenure as Technical Lead at Wipro, I had a career-defining epiphany.
Our team managed a datacenter infrastructure comprising 50 Cisco Catalyst and Nexus switches.
A high-priority security advisory arrived on a Friday afternoon: Update NTP server IP addresses (ntp server 10.100.1.50) and enforce UTC timezone clock settings across all 50 network switches before Monday morning.
It was a simple task.
It was also an operational trap.
The Saturday Night PuTTY Marathon
I opened SecureCRT on Saturday night at 9:00 PM, opened 50 terminal tabs, and began the PuTTY marathon:
# Manual CLI Workflow (Repeated 50 Times):
1. Double-click switch IP in PuTTY -> Enter SSH credentials
2. Type "enable" -> Enter enable password
3. Type "configure terminal"
4. Type "ntp server 10.100.1.50"
5. Type "clock timezone UTC 0"
6. Type "copy running-config startup-config"
7. Close terminal tab -> Move to next switch.
Each switch took approximately three minutes to log in, enter config mode, type commands, save memory, and verify logs.
3 minutes * 50 switches = 150 minutes (2.5 hours) of repetitive, brain-numbing manual typing.
The Mess: Switch 36 and the Fatigue Typo
By 11:30 PM, after two hours of continuous copy-pasting, cognitive fatigue set in.
My eyes were glazed over. I was operating on autopilot.
On switch 36—a core aggregation switch powering a financial database cluster—I intended to type ntp server 10.100.1.50.
Instead, my muscle memory mis-typed a paste command:
# What I accidentally typed on Switch 36:
no ntp server 10.100.1.10
Instead of adding the new NTP server, I stripped the existing NTP server from the running configuration!
Switch 36 lost time synchronization. Within 20 minutes, its system clock drifted by 4 seconds relative to the database servers.
Transaction logging across the database cluster failed with "Timestamp Order Inconsistency" errors.
I spent the next hour frantically debugging clock drift, manually re-adding NTP servers, and verifying database logs.
What should have been a simple change took 4 hours, ruined my weekend, and nearly caused a database outage.
I closed my laptop at 1:30 AM and made a promise to myself:
“Typing configure terminal manually across 50 switches isn’t network engineering—it is manual data entry. If I execute a CLI command manually more than twice, I am going to write a Python script to do it for me.”
The Solution: Multi-Threaded Python Automation with Netmiko
I spent the next two weeks teaching myself Python, learning how to leverage specialized network automation libraries: netmiko (built by Kirk Byers on top of Paramiko) and concurrent.futures.
Netmiko handles all the ugly multi-vendor SSH quirks—connection maintenance, secret prompt waiting, and configuration mode entry—automatically.
Instead of spending 2.5 hours opening terminal tabs, I wrote a 35-line Python script that reads a CSV device inventory, opens concurrent SSH threads, applies configuration changes, and logs results in 14 seconds.
#!/usr/bin/env python3
# Multi-Threaded Cisco IOS Configuration Automation via Netmiko
from netmiko import ConnectHandler
from netmiko.exceptions import NetmikoTimeoutException, NetmikoAuthenticationException
import concurrent.futures
import time
# Device Inventory Array (Loaded from CSV/JSON in production)
DEVICES = [
{'device_type': 'cisco_ios', 'host': '10.100.1.11', 'username': 'admin', 'password': 'Secr3tPassword!'},
{'device_type': 'cisco_ios', 'host': '10.100.1.12', 'username': 'admin', 'password': 'Secr3tPassword!'},
{'device_type': 'cisco_ios', 'host': '10.100.1.13', 'username': 'admin', 'password': 'Secr3tPassword!'}
]
CONFIG_COMMANDS = [
'ntp server 10.100.1.50',
'clock timezone UTC 0'
]
def update_switch_config(device):
host = device['host']
try:
print(f"[*] Connecting to {host}...")
net_connect = ConnectHandler(**device)
net_connect.enable()
# Send declarative configuration commands
output = net_connect.send_config_set(CONFIG_COMMANDS)
net_connect.save_config()
net_connect.disconnect()
return f"✅ SUCCESS: Updated {host}"
except (NetmikoTimeoutException, NetmikoAuthenticationException) as e:
return f"❌ FAILURE on {host}: {str(e)}"
# Execute concurrent SSH sessions across 10 worker threads
start_time = time.time()
with concurrent.futures.ThreadPoolExecutor(max_workers=10) as executor:
results = executor.map(update_switch_config, DEVICES)
for result in results:
print(result)
print(f"⚡ Completed configuration push across {len(DEVICES)} devices in {time.time() - start_time:.2f} seconds!")
Why Python Netmiko Outperformed Manual Terminal Sessions
- Sub-15-Second Execution: 10 concurrent ThreadPool threads updated all 50 switches in 14 seconds total time.
- Zero Human Typo Risk: The exact same string commands were pushed to every device, eliminating muscle memory typos.
- Structured Audit Logs: Every SSH session generated a clean JSON output log showing execution status and prompt confirmation.
The Impact
- 14-Second Execution: Reduced 50-switch configuration updates from 2.5 hours (manual typing) to 14 seconds (Python script).
- Zero Typo Outages: Eliminated 100% of human CLI syntax typos across routine operational changes.
- Career Transformation: Shifted my professional identity from a manual CLI terminal operator to a NetDevOps Automation Architect.
Key Takeaway
Automate Repetitive CLI Tasks Immediately.
Never execute repetitive CLI commands manually across multiple network devices. Learning Python for Network Automation (Netmiko, Paramiko, Nornir) shifts your career from a manual CLI terminal operator to a NetDevOps Systems Architect. If you execute a manual task more than twice, write a script.
Architecture and decisions: mine. Debugging sessions at odd hours: mine. AI assistance: structure, syntax, first draft. — Sachin
Sachin Kumar Sharma
Associate Director (Infrastructure & Cloud Architecture Strategy) | 20+ Yrs Exp
Architecting resilient multi-cloud enterprise landing zones, SDN overlay fabrics, DevSecFinOps automation pipelines, and autonomous Agentic AI platforms.
💡 Related Engineering Articles
Declarative Networking: Automating NSX-T Fabric with Ansible
Why step-by-step imperative network scripts create orphaned API objects, and how declarative NSX-T Policy API models eliminate state drift.
From CLI to Code: Standardizing Network Infrastructure Pipelines
Why manual SSH terminal sessions destroy network auditability, and how we shifted our operations team to a GitOps model using Ansible and GitLab CI.
I Learned BGP on a Delhi Rooftop, Not in a Lab
How aligning WiMAX antennas at -82 dBm in 45°C heat taught me more about network fundamentals than any certification course ever did — and why infrastructure engineers are better prepared for AI than they think.
📬 Stay Updated on Tech Releases
Sign up to get notified when I publish new production war stories, agentic AI architecture blueprints, or open-source infrastructure tools.