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.

send_command_timing "copy tftp flash" to download sw from tftp server

See original GitHub issue

Hi, I want to do tftp with the below commands, to download sw from the server. What can I do to click the enter command after question?

From CLI, Manual config:

R#copy tftp:WANold.pcap bootflash: Address or name of remote host ->I need to type ip address for the first command run Source filename [WANold.pcap]? ->I need to click enter Destination filename [WANold.pcap]? -> i need to click enter Accessing tftp://10.10.12.145/WANold.pcap… Loading WANold.pcap from 10.10.12.145 (via GigabitEthernet0/0/0): ! [OK - 43655 bytes]

Python Script:

net_connect = Netmiko(**host1)
command1 = ("copy tftp:WANold.pcap bootflash:")  # Enter set of commands

print("Connected to:", net_connect.find_prompt())             # Display hostname
output = net_connect.enable()
print(net_connect.find_prompt())

Tftp_server = "10.10.12.145"

output = net_connect.send_command_timing(command1)
if 'Address or name of remote host' in output:
    output += net_connect.send_command_timing(Tftp_server)
if 'Source filename' in output:
    # switch back to send_command() here as this might be slow
    output += net_connect.send_command()
if 'Destination filename' in output:
    # switch back to send_command() here as this might be slow
    output += net_connect.send_command()
net_connect.disconnect()                                        # Disconnect from Session
print(output)

Error:

Traceback (most recent call last): File “C:\Users\tftp-2.py”, line 29, in <module> output += net_connect.send_command() File “C:\Users\venv\lib\site-packages\netmiko\utilities.py”, line 429, in wrapper_decorator return func(self, *args, **kwargs) TypeError: send_command() missing 1 required positional argument: ‘command_string’


def select_cmd_verify(func): “”“Override function cmd_verify argument with global setting.”“”

@functools.wraps(func)
def wrapper_decorator(self, *args, **kwargs):
    if self.global_cmd_verify is not None:
        kwargs["cmd_verify"] = self.global_cmd_verify
    return func(self, *args, **kwargs)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

0reactions
umutyasar19commented, Nov 8, 2020

Hi Kirk,

I used a different command format and worked this time, thank you for the examples, they’re helping me a lot. Do you know somewhere that I can find paramiko examples as well?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Copying from tftp to flash - Cisco Community
Hi am having trouble copying file c3560-ipservicesk9-mz.150-1.SE from tftp server to a new cisco catalyst c3560g switch, I installed the certificationkits ...
Read more >
How to copy cisco iOS from tftp server | iOS upgrade - YouTube
1.Nat Dynamic and Static Click-- https://youtu.be/B0-rK2_jPGE2.How to configure DHCP no cisco router Click-- https://youtu.be/s8xXdADE3ik3.
Read more >
Loading a New IOS Image - Cisco IOS Cookbook, 2nd Edition ...
The copy tftp command allows you to use TFTP to download a new IOS version into the router's flash memory: Router1# copy tftp:// ......
Read more >
Loading the Flash Code using TFTP
Loading the Flash Code using TFTP a. Copy the 08.0.80f non-UFI from the TFTP server into flash memory using the copy tftp flash...
Read more >
Lab 8.4.3a Managing Cisco IOS Images with TFTP
Analyze the Cisco IOS image and router flash memory. • Use TFTP to copy the software image from a router to a TFTP...
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