3 Fallacies That Prevent Network Engineers From Learning Scripting and Automation
I don’t have enough time right now…
Life feels full. There are constant demands on your time. Maybe you’d feel overwhelmed if you took on just a little bit more. I understand. We’ve all been there. “I just have to get done with XXX and then things will settle down and then I’ll be able to start this new thing.” But will you really be done with project XXX any time soon? Will things really settle down afterward? And if they do, will you remember that there was this thing that you wanted to start?
If we were more honest, we might admit that there is never a perfect time to start some things: Parenting. Working out. Learn to play guitar. Learning a new language.
I’m willing to bet that in your recent past, you were able to find time for shopping for that new iPad, or Television, or Car. You probably didn’t even need to find the exact “right time” to start any of that… you just started it and it got done.
The irony about learning how to code is that your life would be so much less overwhelming if only you had some tools to make your computers do more of the work for you. You have to make a small commitment to get to the point of not being overwhelmed. This has to be paid upfront and there is never a good time to start. But if you look at that from another perspective, if there is never a good time to start, then you can get started any time… right now even!
I don’t know any languages…
This seems like a big stumbling block. You don’t know how to code. At all!
And let’s face it… coding is about as hard as learning to speak a new language. The comparison is apt. And here are some thoughts to challenge the way you think about both:
- You have never learned any language by not speaking it.
- You have never become fluent in any language in a classroom.
- All languages are only learned by immersing yourself in their use.
And to immerse yourself, you have to embrace discomfort. And you have to do this often enough until it is not awkward. My advice to those who want to start learning a new language is to just start speaking it and let yourself be awkward for the first bit. Wanna learn to code? Just start writing code.
I don’t know how to begin…
If you are being held back by this thought, you are close to starting. Especially if you ask yourself or people around you how to begin. Or, more specifically, “What’s the smallest step I can take today to code?”.
Start small. Your first bit of code doesn’t even have to be useful.
Anticipate frustration and persist a little bit. When you encounter frustration, set a timer for 10 minutes during which time you will perform google searches for similar examples and try to mimic the examples to get things to work for whatever your current small project is. Then reward yourself with a break.
Make it a new habit. Use your new language skills a little each day. Those skills are either in growth or decay. You need to keep them growing.
Don’t overdo it and burn out.
Building Blocks toward Network Device Scripting
Here is a collection of building block steps I have used to get started:
- Learn a language
- Script login to a router using SSH
- Collect “Show Version” using SSH
- Script a configuration add to a router.
- Have your script isolate the line containing the version number of the router.
- Have your script isolate the text of the version number of the router.
- Use regular expressions to check that the version of the router is some expected value.
- Write a script to upload/download files to/from the router
- Learn XML and XPATH
- Script a login to a router using NetConf over SSH
- Using NetConf, get the version, config, hardware inventory of a router
I used these steps and assembled an API for TCL/EXPECT which will make steps 1-10 pretty darn easy.