Device Prompt Troubleshooting
Device Prompt Troubleshooting
Section titled “Device Prompt Troubleshooting”Device prompts are the second most common cause of connectivity issues. Incorrect prompt configuration prevents rConfig from detecting when command output completes, leading to timeouts or blank configurations.
Understanding Prompt Matching
Section titled “Understanding Prompt Matching”rConfig uses prompts to determine when device command output is complete:
How prompt matching works:
- rConfig connects to device and authenticates
- Device displays its command prompt (e.g.,
Router#) - rConfig sends configuration command (e.g.,
show running-config) - Device returns configuration output line by line
- When device finishes output, it displays prompt again
- rConfig detects prompt reappearance, considers output complete, moves to next command
Prompt matching failures:
- rConfig waits indefinitely for prompt that never appears (timeout)
- rConfig detects false prompt match in command output, truncating configuration
- rConfig cannot match prompt due to regex syntax errors
Common Prompt Configuration Issues
Section titled “Common Prompt Configuration Issues”Using overly generic prompts:
Problem: Prompt configured as # (too generic)
Impact: Device output contains # characters in configuration:
Fortigate-Device # show#config-version=FG200E-6.2.3-FW-build1066-191218:opmode=1:vdom=0:user=someadmin#conf_file_ver=22474973413141345234794rConfig sees first # after command and considers output complete, truncating remainder of configuration.
Resolution: Use complete, specific prompt: Fortigate-Device #
Prompt includes dynamic elements:
Problem: Prompt changes based on mode or configuration:
Router(config)#Router(config-if)#Router(config-router)#Impact: Prompt configured for one mode doesn’t match other modes, causing failures when device changes modes.
Resolution: Use regex to match multiple prompt variations:
Router.*#This matches Router#, Router(config)#, Router(config-if)#, etc.
Regex syntax errors:
Problem: Prompt contains regex special characters not properly escaped:
Router[1]#Impact: Square brackets are regex special characters. Without escaping, regex interprets [1] as character class matching single digit, not literal [1].
Resolution: Escape special characters:
Router\[1\]#Prompt includes whitespace:
Problem: Device prompt includes trailing space not accounted for in configuration:
Router#(note space after #)
Impact: Configured prompt Router# doesn’t match actual prompt Router# (with trailing space), causing detection failure.
Resolution: Include whitespace in configured prompt or use regex to match optional whitespace:
Router#\s*Testing and Correcting Prompts
Section titled “Testing and Correcting Prompts”Step 1: Capture actual prompt:
Log in to device interactively and copy the exact prompt including all characters and whitespace:
Router#Select and copy the prompt text exactly as displayed. Paste into text editor to examine for hidden characters or whitespace.
Step 2: Configure prompt in rConfig:
- Navigate to device edit page
- Locate Prompt field
- Paste exact prompt captured from device
- For devices with multiple modes, use regex to match all variations
Step 3: Test prompt with debug tool:
Use the rConfig CLI debug command or the Live Debug Console to verify prompt detection works correctly. Debug output shows when rConfig detects prompts and how output is captured.
Step 4: Refine if necessary:
If prompt detection still fails:
- Try more specific prompt (include hostname)
- Use regex for flexible matching
- Check for vendor-specific prompt behaviors
- Review device documentation for prompt customization options
For comprehensive prompt configuration guidance, see Device Prompts.