I cannot get a grasp of this whole scripting world. I'm trying though, and my first script I thought I had down but it runs into issues.
In short, and only starting with Arista, I created my script using Netmiko which would log into a device, check the version. If the code was up to date, it would exit out and state as such. If not, it would check flash to see if the latest code was downloaded to flash. If it was, it would exit stating that the device has the latest firmware but it needs to be installed. If it's NOT in flash, it would go out to our FTP site and download the latest version to flash.
That's all i'm trying to do. I thought I had it good with Netmiko but with using the "expect_string", sometimes it would just exit out stating it never found the string I was prompting it to expect, thus, it's not working 100%. This is most likely user error more than Netmiko but Kirk Byers did mention that this is not a good use case for Netmiko (paraphrasing).
With that said, I was thinking about learning how to use Pexpect or whatever, but I figured i'd ask you folks that have more experience here. What tool(s) would you use to create this script? I'm sure it's not a really complex script, it's just i'm having difficult in what to use more than the syntax itself.
Any help would be appreciated.
Thanks.
No comments:
Post a Comment