question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

netmiko cannot handle "admin display-config" output

See original GitHub issue

Got the problem to run netmiko to “admin display-config” (like Cisco IOS “show run”). Anyway to work around? As you can see below, “show time” and “show version” can get the support no problem.

>>> r1 = {'ip':'7750sr12-2','device_type':'alcatel_sros', 'username':'test', 'password':'test'}
>>> import netmiko
>>> nc = netmiko.ConnectHandler(**r1)
>>> nc.send_command('show time')
'\nMon Mar 12 21:58:05 UTC 2018'
>>> nc.send_command('show version')
'\nTiMOS-C-14.0.R5-1 cpm/hops64 Nokia 7750 SR Copyright (c) 2000-2017 Nokia.\nAll rights reserved. All use subject to applicable license agreements.\nBuilt on Thu Aug 10 09:10:28 PDT 2017 by builder in /rel14.0/b1/R5-1/panos/main'
>>> nc.send_command('admin display-config')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/cctsay/miniconda3/lib/python3.6/site-packages/netmiko-2.0.1-py3.6.egg/netmiko/base_connection.py", line 967, in send_command
OSError: Search pattern never detected in send_command_expect: \*B\:alu7750sr12\-2\#
>>> 

Thanks! C.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
cctsaycommented, Mar 16, 2018

Yep it’s working now:)

Thanks! C.

Fri Mar 16 12:57 cctsay@kenny:~]tail -10 alu7750sr12-1.cfg exit no shutdown exit exit

exit all

Finished FRI MAR 16 18:56:59 2018 UTC

Fri Mar 16 12:57 cctsay@kenny:~]head -10 alu7750sr12-1.cfg

TiMOS-C-14.0.R5 cpm/hops64 Nokia 7750 SR Copyright © 2000-2016 Nokia.

All rights reserved. All use subject to applicable license agreements.

Built on Wed Sep 28 15:57:18 PDT 2016 by builder in

/rel14.0/b1/R5/panos/main

Generated FRI MAR 16 18:55:59 2018 UTC

exit all configure #-------------------------------------------------- Fri Mar 16 12:57 cctsay@kenny:~]ls -l alu7750sr12-1.cfg -rw-r–r-- 1 cctsay users 16270344 Mar 16 2018 alu7750sr12-1.cfg Fri Mar 16 12:58 cctsay@kenny:~] Fri Mar 16 12:58 cctsay@kenny:~] Fri Mar 16 12:58 cctsay@kenny:~]ls -l alu7750sr12-2.cfg -rw-r–r-- 1 cctsay users 0 Mar 16 2018 alu7750sr12-2.cfg Fri Mar 16 12:58 cctsay@kenny:~]ls -l alu7750sr12-2.cfg -rw-r–r-- 1 cctsay users 26221796 Mar 16 2018 alu7750sr12-2.cfg Fri Mar 16 12:59 cctsay@kenny:~]

On Fri, Mar 16, 2018 at 11:41 AM, Kirk Byers notifications@github.com wrote:

@cctsay https://github.com/cctsay Okay, try this:

nc.send_command(‘admin display-config’, delay_factor=2, max_loops=2000)

That should allow for roughly 800 seconds for it to complete.

If that fails please post the stack trace.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ktbyers/netmiko/issues/740#issuecomment-373808153, or mute the thread https://github.com/notifications/unsubscribe-auth/Ah_c-40JZ56O3zcZ7JkXAq42z3-hdldgks5tfAdQgaJpZM4Snwb5 .

0reactions
ktbyerscommented, Mar 16, 2018

@cctsay Okay, try this:

nc.send_command('admin display-config', delay_factor=2, max_loops=2000)

That should allow for roughly 800 seconds for it to complete.

If that fails please post the stack trace.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Search pattern never detected in send_command_expect ...
The issue I am facing occurs when running the following code : import netmiko connection = netmiko.ConnectHandler(ip=".
Read more >
Show commands that prompt for more information | netmiko
Enable Netmiko logging of all reads and writes of the communications channel. This will create a file named 'test. log' in the current...
Read more >
Release Notes - eNMS - Read the Docs
Make all results in the Results table link to the workflow builder. ... A non-admin user cannot save a service if it is...
Read more >
Solved: Python netmiko error - Cisco Community
As per the logs, it seems that it is trying use your file as part of the Netmiko library and is failing. ImportError:...
Read more >
Interacting with IOS XE and IOS XR using Netmiko
What is Netmiko · Successfully establish an SSH connection to the device · Simplify the execution of show commands and the retrieval of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found