Tuesday, April 21, 2020

python newb here, but I have a use case and want to try python.

Let me start off by saying I have zero experience with python, but I have a scenario where I think python can be used.

I'm not sure if a GUI needs to be involved or if this is all done via CLI, but I'd like to use python to ssh into a switch run a handful of commands, wait a few seconds and run a few more commands and exit.

Something along the lines of

ssh [ip of switch] and credentials enable conf t interface gi1/0/11 shut power inline never 

short pause

no shut power inline auto exit 

Something along those lines. I would like it to be interactive in order to input the correct IP for ssh (including credentials) and being able to modify the port. As you can see, all this is doing is a power cycle and shut/no shut of a single port. I'm assuming a front end is also built with python that would contain the fields and when a button is pressed the commands are executed once the ssh session is created. I could be way off base here, but that's what I'm picturing.

Am in in over my head with having zero experience? The most I've done with python is followed a video showing someone creating a python script that displays Hello World! or something like that.

Thanks.



No comments:

Post a Comment