Advertisement
Guest User

Untitled

a guest
Mar 21st, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. import sys
  4. import paramiko
  5.  
  6. # Create the argvs
  7. switch=sys.argv[1]
  8. port=sys.argv[2]
  9.  
  10. ssh = paramiko.SSHClient()
  11.  
  12. ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  13. ssh.connect(switch, port=22, username='rcuser', password="andy_cole",)
  14. stdin, stdout, stderr = ssh.exec_command('show ethernet-switching table interface ' +port)
  15. output = stdout.readlines()
  16.  
  17. print '/n'.join(output)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement