Advertisement
Guest User

input

a guest
Aug 30th, 2016
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. import sys
  2. import telnetlib
  3. import os
  4.  
  5.  
  6. HOST = "10.10.10.10"
  7. user = "user"
  8. password = "password"
  9.  
  10. tn = telnetlib.Telnet(HOST)
  11.  
  12. tn.read_until("login:",10)
  13. tn.write(user + "\n")
  14. if password:
  15. tn.read_until("password:",10)
  16. tn.write(password +"\n")
  17.  
  18. tn.write("show equipment ont interface\n")
  19. tn.write("logout\n")
  20.  
  21. print tn.read_all()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement