Using Configuration Management commands with queries
- Last Updated: June 12, 2026
- 2 minute read
- WhatsUp Gold
- Version 2026
- Version 2025
- Version 2024
- Version 2023.1
Some Device commands require users to answer a question before the
command is executed. For example, the enable command on Cisco devices
queries the user for a password before executing the command. For this reason, a command
can optionally specify a QUERY which specifies the question asked by the device and the
answer that should be given to the question. The QUERY is specified after the command
within curly braces. For example,
shutdown { "Are you sure? ", "Y" }
The first value inside the curly braces is a String or Regular Expression
describing the query prompt displayed by the device. The second value inside the curly
braces is a String specifying the query response that should be entered in response to
the query prompt. When the script interpreter executes this command, it will first send
shutdown to the device. Next, it will wait until it receives the
"Are you sure? " query prompt. Then, it will send Y to the device as
the query response. Finally, the device will execute the command.
@logout.@logout is the only Configuration
Management command that supports an optional QUERY clause. This allows scripts to
respond to device prompts that may occur when logging out (for example, confirmation
prompts).
For example,
enable { $(PasswordPrompt), "$(Settings.PrivilegedPassword)" }
@pause or @wait.
Scripts execute commands sequentially and rely on device responses and timeout settings
(such as ReadTimeout) to control execution flow.