Python Forum

Full Version: Project programming advice
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am a noob trying to learn Python and I have found a case I think I could use for that.

I have a bunch of Alcatel switches to which I can do SSH connection with Putty.
I need to know which ports are DOWN and have not been used for more then 3 months and print them in to TXT or Ecxel.

This is the manual workflow-

- Once logged in with SSH (user name and password), I run this command: show interfaces status.
- I get the long table with ports. see picture [Image: Screenshot%2011.png?dl=0]
- Then I enter : show interfaces [port number] and get table data for this for this port. [Image: Screenshot%2022.png?dl=0]
- If the port is DOWN and Last Time Changed > 30 days, I sent it to TXT file.

Is it possible do automate this with Python? If yes, I would like to build the code myself but I am clueless how to do it. Maybe a roadmap?

Thank you for advise!
The first idea is to use module paramiko or a wrapper around this module to execute remote commands over ssh. See this page, also search ssh keyword on pypi in order to find available modules. Use only trustworthy modules.