Using WhatsConfigured commands with queries

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.

Note: Only Device commands can have a QUERY. WhatsConfigured commands do not need a QUERY, and, in fact, may not have one.

For example,

enable { $(PasswordPrompt), "$(Settings.PrivilegedPassword)" }

See Also

Using WhatsConfigured Commands

About commands

About basic WhatsConfigured command syntax

About strings and regular expressions in WhatsConfigured

About "$"

Storing WhatsConfigured command output in the WhatsUp Gold database

Editing WhatsConfigured command output

About WhatsConfigured command layout

WhatsConfigured script variables affecting command execution

About WhatsConfigured command types