Speed up Netmiko

Started by dlots, January 25, 2017, 03:21:17 PM

Previous topic - Next topic

dlots

Just figured I would throw this out there, all the code I have posted to date has used

output = net_connect.send_command(command)
Which seems to always take ~30 seconds

Today I learned about
output = net_connect.send_command_expect(command)
which cuts the time down quite abit on average.

wintermute000

thanks for the tip. Whats the difference other than speed? Why bother with the first at all then?

Haven't looked much @ Netmiko directly TBH, its just easier to leverage jedelmen's work and go straight to ansible core modules or NAPLAM etc.

dlots

I think the diffrence is that the 1st one just waits ~30 seconds, the 2ed one waits till it gets a command prompt i think.

Not 100% sure

I haven't looked at ansible, I'll take a look at it.  Thank you :-D

that1guy15

Quote from: dlots on January 26, 2017, 12:46:34 PM
I think the diffrence is that the 1st one just waits ~30 seconds, the 2ed one waits till it gets a command prompt i think.

Not 100% sure

I haven't looked at ansible, I'll take a look at it.  Thank you :-D

Interesting. Didnt know this myself either. Thanks!

Drop the question in NTC netmiko channel Im sure Kirk Byers will be the first response. Or hit him up on twitter. BTW he is the creator of netmiko.
That1guy15
@that1guy_15
blog.movingonesandzeros.net