Configure Device Prompts in rConfig V8 Core
Device prompts tell rConfig V8 Core when a device has finished returning command output and is ready for the next command. After reading this page, you can configure accurate main and enable prompts, write regex patterns for variable or multi-mode prompts, and troubleshoot the backup timeouts and incomplete captures that prompt mismatches cause.
When to use this
Section titled “When to use this”Use this page when you are adding a device or vendor template and need to set its prompt pattern, or when backups are timing out, returning truncated configs, or failing CIC checks. Prompt configuration is the most common cause of these symptoms, so it is the first thing to check when a device captures slowly or incompletely.
Prerequisites
Section titled “Prerequisites”- A configured device or vendor in rConfig (see Add and manage devices and Vendors)
- The actual prompt the device displays, captured from a live SSH or Telnet session
- For regex patterns: basic familiarity with regular expressions, or access to regex101.com for testing
What are device prompts?
Section titled “What are device prompts?”Device prompts are the text strings a network device displays to signal it is ready for the next command. rConfig matches these patterns to know when command output has finished, then proceeds to the next command in the backup sequence.
Common prompts by vendor:
- Cisco IOS / IOS-XE:
Router#orRouter(config)# - Juniper JUNOS:
user@router>oruser@router# - Arista EOS:
switch#orswitch(config)# - Palo Alto Networks:
admin@PA-firewall>oradmin@PA-firewall#
When the configured pattern does not match what the device actually displays, rConfig waits for the command timeout before continuing. That produces slow backups, truncated output, and failed integrity (CIC) checks.
Main prompt vs enable prompt
Section titled “Main prompt vs enable prompt”rConfig uses two prompt fields to handle different CLI modes.
| Field | When it is used | Typical value |
|---|---|---|
| Main prompt | After every standard command during a backup | hostname#, user@hostname>, .*# |
| Enable prompt | After the enable / privilege escalation command, before privileged commands run | hostname# (often the same as main) |
Not every device needs a separate enable prompt. If the device shows the same prompt before and after privilege escalation, set the enable prompt to match the main prompt. Set them differently only when the device shows a distinct privileged-mode indicator, for example main user@device> and enable user@device#.
Basic prompt configuration
Section titled “Basic prompt configuration”For devices with a consistent prompt, a static value is reliable. If a device always displays Router-NYC#:
Main Prompt: Router-NYC#Enable Prompt: Router-NYC#Configuration sub-mode prompts like Switch-LAB(config)# do not need separate configuration as long as they end with #, which the standard pattern already matches.
For multiple devices that share a naming convention, use a wildcard. Router-.*# matches Router-Site1#, Router-NYC#, and Router-Production-East#. The broadest pattern, .*#, matches virtually any prompt ending in #.
Regex prompt configuration
Section titled “Regex prompt configuration”rConfig V8 Core supports regular expressions in the prompt fields, which handles dynamic hostnames, multiple CLI modes, and multi-vendor environments.
Regex syntax essentials
Section titled “Regex syntax essentials”Metacharacters used in prompt patterns:
| Token | Meaning |
|---|---|
. | Any single character |
.* | Any sequence of characters (zero or more) |
.+ | Any sequence of characters (one or more) |
? | Makes the preceding element optional |
| | OR operator (match this or that) |
^ | Start of line anchor |
$ | End of line anchor |
\d | Any digit |
\w | Any word character (letter, digit, underscore) |
\s | Any whitespace |
Characters that must be escaped with a backslash to match literally: ( ) [ ] { } . * + ? | ^ $. For example, write \(config\) to match the literal parentheses in hostname(config)#.
Common regex scenarios
Section titled “Common regex scenarios”Variable hostname with a fixed suffix (myrouter-NYC#, myrouter-LAB#):
myrouter-.*#All configuration mode prompts (hostname(config)#, hostname(config-if)#, hostname(config-vlan)#):
hostname\(config.*\)#$Here \( and \) match the literal parentheses, config.* matches config plus any sub-mode, and #$ anchors the # to the end of the line.
Match either # or > for a multi-vendor environment:
.*[#>]$Prompts with a trailing privilege level (router#15, router#1, router#):
router#\d*$\d* matches zero or more digits after #, so it covers prompts with and without a level number.
Advanced techniques
Section titled “Advanced techniques”Use anchors for precise matching. ^hostname.*#$ ensures hostname is at the start of the line and # is at the end, preventing a match against some-prefix-hostname#.
Use alternation to match multiple device families: (Router|Switch|Firewall)-.*#.
Use optional groups to make whole sections optional. hostname(-\w+)?\(config\)# matches both hostname(config)# and hostname-site01(config)#.
Use character classes for exact formats. Router-[A-Z]{3}\d{2}# matches Router-NYC01# and Router-LAB02# (three uppercase letters then two digits).
Test and validate a regex pattern
Section titled “Test and validate a regex pattern”Test every pattern against real device output before deploying it.
- Capture the actual prompt from a live SSH or Telnet session to the device.
- Open regex101.com and select PHP as the flavor.
- Enter your pattern in the regular expression field, with no delimiters.
- Paste the captured prompts (and any prompts that should NOT match) into the test string field.
- Confirm every expected prompt matches and unwanted prompts do not.
- Read the explanation panel to confirm each token does what you intend.
For a Cisco device that may sit in several config modes, test all of these strings against a pattern such as .*\(config.*\)?#$:
Router-NYC#Router-NYC(config)#Router-NYC(config-if)#Router-NYC(config-router)#Switch-LAB#Switch-LAB(config-vlan)#Apply and verify in rConfig
Section titled “Apply and verify in rConfig”After you have a tested pattern:
- Enter the pattern in the Main Prompt and Enable Prompt fields on the device or vendor template, without delimiters.
- Run a backup of a single device to confirm prompt detection (
php artisan rconfig:device-backup --device-id=123, adjusting the ID for your environment). - Review the log for prompt or timeout warnings:
grep -i "prompt\|timeout" /var/www/html/rconfig/storage/logs/laravel.log- Open the captured configuration and confirm it is complete and passes its CIC check.
- Check the backup duration: no timeout delay confirms the prompt matched on every command.
Vendor pattern reference
Section titled “Vendor pattern reference”| Vendor | Typical prompt | Recommended pattern |
|---|---|---|
| Cisco IOS / IOS-XE | Router# or Router(config)# | .*\(config.*\)?#$ |
| Juniper JUNOS | user@router> or user@router# | .*@.*[>#]$ |
| Arista EOS | Switch# or Switch(config)# | .*\(config.*\)?#$ |
| Palo Alto Networks | admin@firewall> or admin@firewall# | .*@.*[>#]$ |
| HP ProCurve / Aruba | Switch# or Switch(config)# | .*\(config.*\)?#$ |
| Fortinet FortiGate | FortiGate # or FortiGate (config) # | .* (\(.*\) )?#$ |
Troubleshoot prompt issues
Section titled “Troubleshoot prompt issues”Backups time out or run slowly
Section titled “Backups time out or run slowly”The configured pattern does not match the actual prompt, so rConfig waits for each command timeout before continuing. Connect to the device manually, compare its real prompt with your pattern, and check the log for timeout warnings:
tail -n 200 /var/www/html/rconfig/storage/logs/laravel.log | grep -i "timeout\|prompt"Update the pattern to match the live prompt and re-test at regex101.com. Each mismatch can add the full command timeout (often 10 to 30 seconds) per command, which across a 20-command backup and hundreds of devices significantly extends the backup window.
Configuration output is incomplete
Section titled “Configuration output is incomplete”rConfig stopped capturing early because the pattern matched text inside the command output. A bare # pattern, for example, matches description Link to Core Switch #1 mid-config. Anchor the pattern to the full prompt line instead:
.*#$The leading .* and trailing $ ensure the pattern matches a complete prompt line rather than any stray # in the output.
Enable command fails
Section titled “Enable command fails”The enable prompt does not match the privileged-mode prompt, so rConfig does not recognise successful escalation. Run enable manually on the device, note the resulting prompt, and set the enable prompt to match it. Where user and privileged prompts are identical, set both fields to the same pattern.
Pattern matches too broadly
Section titled “Pattern matches too broadly”A generic pattern is matching prompts from unintended devices or command output. Narrow it toward your actual device naming, for example from .*# to Router-.*# to Router-Production-\d{2}#.
When debugging a complex pattern, build it up one token at a time (hostname, then hostname\(config, then hostname\(config.*\)?#$) to find which part fails, and test against the exact prompt copied from a live device.
Quick reference
Section titled “Quick reference”Special characters that need escaping in a prompt pattern: ( → \(, ) → \), [ → \[, ] → \], { → \{, } → \}.
Configuration checklist:
What’s next
Section titled “What’s next”- Add and manage devices to set prompts on a specific device
- Commands to see how prompts interact with command execution
- Connection templates to apply prompts across a device family
- Configuration backups to run the backups that prompt detection drives
- Troubleshoot device connectivity for wider backup failure diagnosis