For the last couple of years, all I’ve heard online in communities like this one is “learn python.”
So I hit “Learn Python the Hard Way,” and signed up for Kirk Byers class.
Fast forward about a year later, and I’m moderately able to take a basic task and turn it into a script. Nothing that mind boggling. Among the scripts I’ve made are:
-
Classic “take cdp/lldp neighbors output and write it to interface descriptions” that everyone typically makes
-
Basic mass configuration push out script with built in “safety measures” leveraging our OOB net
-
Basic inventory script that writes a csv file with every serial number because we found our NMS often shows the wrong serial or excluded SFPs & line cards. (My first regexp script)
-
Basic script that finds all ports without 802.1x enabled and writes them to a CSV with port description, or turns it back on if there’s no port description present. (Heavily uses regexp)
-
a script that compares current routing table against a baseline.csv and finds added, removed, changed routes including change of metric, change of next hop (because who knew netdiff already existed and it sounded like a fun challenge.)
-
script that pulls management and cos acls off boxes and compares them to stored templates, and emails out a discrepancies report (my first every script with smtp)
-
my first ever API script with requests that pulls information out of one system and then pushes commands to a different system depending on the information it gathered
While I’m happy with my progress I recognized a few discouraging things.
-
Pretty much all my scripts are one-off, single-purpose scripts that solved some problem or ask at the time, and now may not really need to run anymore
-
Failure to adapt/buy-in from co-workers to use any of the scripts, or to learn scripting and contribute to projects. Also one who never misses the chance to point out he could do this much easier by opening multiple tabs in SecureCRT.
-
Failure to revolutionize. Learning this has been fun and personally rewarding, but it hasn’t changed the way we do things. I still spend 90% of my days in CLI manually doing stuff.
Also some other observations: it takes time. Some of the scripts listed above took me a whole 40 hour work week to make, some longer than that. The ROI is non-existent because I really could have done the work manually much faster, and it’s not an on-going or repeatable task. Yes some of my scripts are now “tools” that I can use at will, but it feels more like a novelty than a game changer.
On top of all that, the rhetoric has mostly changed now on the blogosphere to where they’re now saying “don’t learn python for network automation. Use SALT, Ansible, Chef, etc.”
Has it all been a waste? I don’t regret learning this, but I wonder if it’s the correct path. Like how much is that really going to bolster my career. We also have a tiny environment where we don’t push new switches out regularly, is automation even viable for such an environment? And how big of a learning curve is it going from simple netmiko scripting to standing up an “automation stack” like Ansible or Salt, knowing there likely wouldn’t be any buy-in to doing so from the enterprise.
No comments:
Post a Comment