Apr-26-2018, 04:24 PM
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]](https://www.dropbox.com/s/mrjlh0ip8o1lyvw/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]](https://www.dropbox.com/s/leilgdtzbz7gwx7/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!
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]](https://www.dropbox.com/s/mrjlh0ip8o1lyvw/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]](https://www.dropbox.com/s/leilgdtzbz7gwx7/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!