Netmiko send_command vs send_command_timing prompt handling

300-435 By islever Editorial Last updated

Short answer

A Send_command blocks until the device prompt pattern matches, while send_command_timing reads output on a timing basis, so the prompt-wait versus fixed-delay distinction in A is correct.

Question

What is 'send_command' vs 'send_command_timing' in Netmiko?
  1. send_command waits for prompt; send_command_timing waits fixed time Correct Answer
  2. Same
  3. send_command_timing faster
  4. send_command timing

Key Takeaways

Netmiko’s send_command and send_command_timing differ in how they decide a command has finished: send_command waits for a device prompt pattern, while send_command_timing uses a timing-based read. That makes option A correct because the core distinction is prompt matching versus a fixed wait, not speed or equivalence.

Expert Analysis

send_command waits for prompt pattern. send_command_timing uses fixed delay.

The decisive difference is completion detection: send_command treats the device prompt as the end-of-output signal, while send_command_timing uses elapsed time or output quiet time. Option A names exactly that contrast, so it is the choice that describes the two Netmiko methods rather than an equivalence or a performance claim.

send_command writes the command to the channel and then reads until a prompt pattern is matched. In Netmiko, that prompt is derived from the connection's base prompt and device_type, with an optional expect_string for a custom pattern. On a Cisco IOS XE device whose prompt is router#, an ordinary show command returns when router# is seen. That makes execution deterministic for well-behaved commands: the method does not wait for a fixed timer after the prompt arrives, so it can return as soon as the CLI is ready for the next command. It also means the command depends on a recognizable, stable prompt. If the prompt changes after enable or configuration mode, or if output contains a prompt-like string, the read can end early or block until timeout.

send_command_timing writes the command and then reads according to a delay-based loop. At exam level it is described as waiting a fixed time; operationally Netmiko uses delay_factor and quiet-time detection to decide that the device has stopped sending output. This method does not need to match router# or any other prompt. It is useful when a command produces nonstandard interaction or no normal prompt, such as confirmation dialogs, reload prompts, or commands that keep the channel busy. The trade-off is precision: a long delay_factor adds latency to every timed command, while a short delay can return before slow output finishes. This is why timing mode is not inherently faster and why option C is wrong as a general statement.

The mechanism that decides many real outcomes is prompt-regex matching versus output-quiet detection. For example, send_command with a default base prompt may work on router# but fail after the session enters a different prompt context or when a banner echoes a string that looks like the prompt. The same command under send_command_timing will not care about the prompt shape; it will keep reading until the configured quiet interval passes, which is why it is often chosen for menus and confirmations even though it can be slower. That distinction is the operational meaning behind "prompt" versus "timing" in the option text.

Option B ("Same") fails because the two methods use different end-of-output criteria and have different failure modes. With send_command, a mismatched prompt regex can cause a timeout even though the command completed; with send_command_timing, a short quiet interval can truncate output even though the prompt is irrelevant. Those are not interchangeable behaviors.

Option C says send_command_timing is faster. Timing mode waits through its delay after output quiets, and increasing delay_factor makes it slower, so it cannot be called faster as a rule. On a stable CLI that returns a prompt promptly, send_command usually completes as soon as the prompt appears, without an extra fixed delay. Speed depends on prompt behavior, output cadence, and delay_factor, not on the method name alone.

Option D, "send_command timing," is not a meaningful distinction; it merely repeats part of the method name without saying what changes. The real distinction is that send_command is prompt-driven and send_command_timing is timing-driven, which is exactly option A. Netmiko method names encode that behavior, so for a stable Cisco prompt use send_command; for timing-based interaction use send_command_timing.

Official Reference

Exam Strategy

When comparing Netmiko methods, anchor on the completion trigger rather than perceived speed: prompt-matching methods are deterministic but can hang if the prompt regex never matches, while timing methods tolerate odd prompts but need delay tuning. Map each option to those two triggers before considering performance claims; options that say "same" or "faster" are usually distractors unless the item names a specific timeout or delay_factor. For 300-435, remember that Netmiko method names encode behavior: send_command is prompt-driven and send_command_timing is timing-driven.

Practice All 300-435 Questions

Access 150 questions with complete answers and detailed explanations.

View Full 300-435 Practice Test →

← Back to 300-435 Study Guide