Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Project programming advice
#1
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!
Reply
#2
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  programming OpenOffice with External Python Project bobthebuilder44 1 1,367 Apr-07-2023, 06:02 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020