16.01.2013 Views

Ipswitch WhatsUp Gold User Guide - Ipswitch Documentation Server

Ipswitch WhatsUp Gold User Guide - Ipswitch Documentation Server

Ipswitch WhatsUp Gold User Guide - Ipswitch Documentation Server

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Ipswitch</strong> <strong>WhatsUp</strong> <strong>Gold</strong> <strong>User</strong> <strong>Guide</strong><br />

4 After entering the user name and password (if necessary), if @enable detects<br />

CommandPrompt, it assumes that enable was successful. Otherwise, it assumes that<br />

enable failed.<br />

If at any time the device's output stalls for more than Settings.ReadTimeout seconds, it is<br />

assumed that something is wrong, and the script returns failure.<br />

Device commands<br />

After invoking the @login command (and possibly @enable as well), most scripts contain a<br />

sequence of Device commands that are sent to the device for execution. A typical Device<br />

command is shown below:<br />

Device commands are executed as follows:<br />

[last-words] shutdown { "Are you sure? ", "Y" }<br />

The script sends the command text to the device. It terminates the command with<br />

CommandTerminator.<br />

If the command has a query, the device returns the query to the script. When it detects the<br />

query prompt, the script sends the query response to the device.<br />

Next, the device executes the commands, and sends its output back to the script.<br />

If the command's output is long enough to result in more prompts, when the script detects a<br />

MorePrompt, it sends MoreResponse to the device.<br />

The script consumes the command's output until it detects CommandPrompt, at which point it<br />

assumes that the command's output is complete.<br />

If at any time the device's output stalls for more than Settings.ReadTimeout, it is assumed<br />

that something is wrong, and the script returns failure.<br />

If the command succeeds, and it has a KEY, its output is saved in the <strong>WhatsUp</strong> <strong>Gold</strong> database.<br />

The following script is typical:<br />

@login<br />

enable { "password: ", "$(Settings.PrivilegedPassword)" }<br />

[running-config] show run<br />

[-] logout<br />

This script first logs in with the @login command, then enters privileged mode with the<br />

@enable command.<br />

Next, the script sends the show run command to the device. The output of this command is<br />

saved in the WUG database under the running-config key.<br />

1149

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!