Monday, November 15, 2021

Network automation - Netmiko, Pexpect, or both?

Hi!

While I have like 15 years of networking experience, I'm fairly new to automation and I'd love to learn more. I'm not sure I get it, so I hope you can explain.

I've recently started automation via expect, and found it pretty simple to learn but also limited in what it can do (or at least, some things are HARD in expect). So I heard Python is the stuff! I've studied the basics of Python, but I find myself having a hard time with all programming until I have a concrete goal. So I figured I might as well start scripting, and try to translate my old expect scripts.

What I don't get is the relationship between Netmiko and Pexpect. Are they totally different modules made to be used separately? Or can you use both and do a bit as you like?

I've tested a few things with Netmiko, but found it really hard since I'm used to Expect. Netmiko felt a bit "blind", I wasn't sure if it was working until I printed output from a command. Maybe Pexpect is run a bit more like Expect - with a live output? Or how do you use them? Is one better than the other or do they only do different things? How should I go about this and maybe you can recommend some good place to learn more?

Appreciate your input! Thanks!



No comments:

Post a Comment