Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *Script on VSCODE*
- import paramiko
- ip =x.x.x.x
- port = x
- username = username
- password = password
- cmd='show interface status'
- ssh=paramiko.SSHClient()
- ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- ssh.connect(ip,port,username,password)
- stdin,stdout,stderr=ssh.exec_command(cmd)
- outlines=stdout.readlines()
- resp=''.join(outlines)
- print (resp)
- PORT NAME STATUS VLAN DUPLEX SPEED
- Gi1/0/11 notconnect 33 auto auto
- Gi1/0/12 notconnect 6 auto auto
- Gi1/0/13 notconnect 60 auto auto
- PORT STATUS VLAN
- Gi1/0/11 notconnect 33
- Gi1/0/12 notconnect 6
- Gi1/0/13 notconnect 60
- PORT NAME STATUS VLAN DUPLEX SPEED
- string [0] string [?] string [1] string [2] string[3] string [4]
- Gi1/0/11 notconnect 33 auto auto
- string [5] string[?] string[6] string [7] string[8] string[9]
Add Comment
Please, Sign In to add comment