Device Prompt Troubleshooting
Device Prompt Troubleshooting
Section titled “Device Prompt Troubleshooting”Device prompts are the second most common cause of backup failures. An incorrect prompt configuration prevents rConfig from detecting when command output is complete, leading to timeouts or truncated configurations.
When to use this
Section titled “When to use this”Use this guide when rConfig can reach and authenticate against a device but backups time out, return empty output, or return truncated configurations. Prompt detection failures are the cause if CLI debug output shows rConfig waiting indefinitely for a prompt, or if it marks output complete too early.
Prerequisites
Section titled “Prerequisites”- Basic network connectivity confirmed (see Basic Connectivity Verification)
- Authentication working: the device accepts rConfig credentials via SSH or Telnet
- Shell access to the rConfig server and interactive access to the target device
How Prompt Matching Works
Section titled “How Prompt Matching Works”rConfig uses prompts to determine when device command output is complete:
- rConfig connects to the device and authenticates
- The device displays its command prompt (e.g.,
Router#) - rConfig sends a configuration command (e.g.,
show running-config) - The device returns configuration output line by line
- When output is complete, the device displays the prompt again
- rConfig detects the prompt, considers output complete, and moves to the next command
Prompt matching failures:
- rConfig waits indefinitely for a prompt that never appears (timeout)
- rConfig detects a false prompt match inside command output, truncating the configuration
- rConfig cannot match the prompt due to a regex syntax error
Common Prompt Configuration Issues
Section titled “Common Prompt Configuration Issues”Overly generic prompt:
A prompt set to # matches the first # character anywhere in command output, not just the device prompt. For example:
Fortigate-Device # show#config-version=FG200E-6.2.3-FW-build1066-191218:opmode=1:vdom=0:user=someadmin#conf_file_ver=22474973413141345234794rConfig sees the first # after the command and considers output complete, truncating everything after it. Use the full prompt instead: Fortigate-Device #.
Dynamic mode prompts:
Some devices change their prompt based on configuration mode:
Router(config)#Router(config-if)#Router(config-router)#A prompt matched to Router# will not match these variants, causing failures when the device enters a sub-mode. Use a regex pattern to cover all variations:
Router.*#Regex special characters not escaped:
A prompt like Router[1]# contains square brackets, which are regex special characters. Without escaping, the regex interprets [1] as a character class. Escape them:
Router\[1\]#Trailing whitespace:
Some devices append a space after the prompt character. The configured prompt Router# will not match Router# (with a trailing space). Include optional whitespace in the pattern:
Router#\s*Testing and Correcting Prompts
Section titled “Testing and Correcting Prompts”-
Capture the actual prompt:
Log in to the device interactively and copy the exact prompt including all characters and whitespace:
Terminal window ssh admin@192.168.1.1Router#Paste the prompt text into a text editor to check for hidden characters or trailing spaces.
-
Configure the prompt in rConfig:
Navigate to the device edit page, locate the Prompt field, and paste the exact prompt. For devices with multiple modes, use a regex pattern to match all variations.
-
Test prompt detection:
Use the rConfig CLI Diagnostic Tools or the Live Debug Console to verify prompt detection. Debug output shows exactly when rConfig detects prompts and how output is captured.
-
Refine if necessary:
If prompt detection still fails, try a more specific prompt that includes the hostname, apply regex for flexible matching, or review vendor documentation for prompt customisation options.
What’s next
Section titled “What’s next”- rConfig CLI Diagnostic Tools - Run a verbose debug session to observe prompt detection in real time
- Live Debug Console - Stream the same real-time output directly in the browser
- Device Prompts - Full reference for prompt configuration options in rConfig