This WORKS:
I used to write device drivers for Cisco vendor..
Where I login to there device using putty via Telnet device IP and it enters into device and use some commands in my script to get information .. like show version command in my script n get I read all info into CSV file.
Solution for below problem
Now we got a new vendor called NORTEL.. When i use there IP’s in putty it enters the device where it complete menu or keyboard driven..
- It ask to press Ctrl-y to continue and list of options like “hardware info” using arrow keys i need to select n enter to get info.
HOW DO I WRITE SCRIPT to enter the nortel device which is completly keybord drive .. like ctrl-y ctrl x , using arrow keys etc
Use pexpect. It’s a python module designed for interaction with local or remote processes. Here’s an example from its website showing how you can use it to connect to a keyboard-driven FTP subprocess.
All you’ll need is to lookup the special control codes for keys such as control.