Guest User

Untitled

a guest
Jan 9th, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. *Script on VSCODE*
  2.  
  3. import paramiko
  4. ip =x.x.x.x
  5. port = x
  6. username = username
  7. password = password
  8. cmd='show interface status'
  9.  
  10. ssh=paramiko.SSHClient()
  11. ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  12. ssh.connect(ip,port,username,password)
  13.  
  14. stdin,stdout,stderr=ssh.exec_command(cmd)
  15. outlines=stdout.readlines()
  16. resp=''.join(outlines)
  17. print (resp)
  18.  
  19. PORT NAME STATUS VLAN DUPLEX SPEED
  20. Gi1/0/11 notconnect 33 auto auto
  21. Gi1/0/12 notconnect 6 auto auto
  22. Gi1/0/13 notconnect 60 auto auto
  23.  
  24. PORT STATUS VLAN
  25. Gi1/0/11 notconnect 33
  26. Gi1/0/12 notconnect 6
  27. Gi1/0/13 notconnect 60
  28.  
  29. PORT NAME STATUS VLAN DUPLEX SPEED
  30. string [0] string [?] string [1] string [2] string[3] string [4]
  31.  
  32. Gi1/0/11 notconnect 33 auto auto
  33. string [5] string[?] string[6] string [7] string[8] string[9]
Add Comment
Please, Sign In to add comment