...
telnet Trying 172.16.125.131... Connected to 172.16.125.131. Escape character is '^]'. User Access Verification login: admin Password: 9k# python Python 2.7.5 (default, Nov 5 2016, 04:39:52) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import cli >>> cli.cli("show interface mgmt0") <<<<<<<<<<<<<<<<<<<<<<<<<<< *********************** HANGS ************************** ^CTraceback (most recent call last): <<<< Ctrl-C to break File "", line 1, in File "/isan/python/scripts/cli.py", line 57, in cli output,error = p.communicate() File "/isan/python/python2.7/subprocess.py", line 806, in communicate return self._communicate(input) File "/isan/python/python2.7/subprocess.py", line 1382, in _communicate stdout, stderr = self._communicate_with_poll(input) File "/isan/python/python2.7/subprocess.py", line 1436, in _communicate_with_poll ready = poller.poll() KeyboardInterrupt >>> cli.cli("show interface mgmt0 br") '\n--------------------------------------------------------------------------------\nPort VRF Status IP Address Speed MTU\n--------------------------------------------------------------------------------\nmgmt0 -- up 172.16.125.131 1000 1500\n' Command may succeed after several attempts as shown above but no clear pattern (below it did not) 9k# python Python 2.7.5 (default, Nov 5 2016, 04:39:52) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import cli >>> cli.cli("show version") ^CTraceback (most recent call last): File "", line 1, in File "/isan/python/scripts/cli.py", line 57, in cli output,error = p.communicate() File "/isan/python/python2.7/subprocess.py", line 806, in communicate return self._communicate(input) File "/isan/python/python2.7/subprocess.py", line 1382, in _communicate stdout, stderr = self._communicate_with_poll(input) File "/isan/python/python2.7/subprocess.py", line 1436, in _communicate_with_poll ready = poller.poll() KeyboardInterrupt >>> cli.cli("show version") ^CTraceback (most recent call last): File "", line 1, in File "/isan/python/scripts/cli.py", line 57, in cli output,error = p.communicate() File "/isan/python/python2.7/subprocess.py", line 806, in communicate return self._communicate(input) File "/isan/python/python2.7/subprocess.py", line 1382, in _communicate stdout, stderr = self._communicate_with_poll(input) File "/isan/python/python2.7/subprocess.py", line 1436, in _communicate_with_poll ready = poller.poll() KeyboardInterrupt >>> cli.cli("show version") ^CTraceback (most recent call last): File "", line 1, in File "/isan/python/scripts/cli.py", line 57, in cli output,error = p.communicate() File "/isan/python/python2.7/subprocess.py", line 806, in communicate return self._communicate(input) File "/isan/python/python2.7/subprocess.py", line 1382, in _communicate stdout, stderr = self._communicate_with_poll(input) File "/isan/python/python2.7/subprocess.py", line 1436, in _communicate_with_poll ready = poller.poll() KeyboardInterrupt
TRIGGER 1. Use telnet to connect 2. Run Python 3. Import CLI module 4. Issue commands: cli.cli("show command")
Do not use telnet. Issue not seen with console or SSH access
affects both 3K and 9K