

Command Execution › Run Telnet Command Operator › Example
Example
Use the Run Telnet Command operator interactively
The Run Telnet Command operator operates in the following interactive manner:
- Open a Telnet connection to the remote host.
- Do one of the following:
- If no login is required, go to step 8.
- If password only login is required, go to step 4.
- If user name and password login is required, then read from the Telnet session until one of the following occurs:
- You match the pattern specified in User Login Text Prompt. (Go to Step 3.)
- The Time to Wait for Prompts is up. If this time elapses, the operator fails.
- Send the User name.
- Read from the Telnet session until one of the following occurs:
- You match the pattern specified in User Password Text Prompt (go to Step 5).
- The Time to Wait for Prompts expires. If this occurs, fail the operator.
- Send the password, then:
- Read from the Telnet session until one of the following occurs:
- You match the pattern specified in User Command Prompt, and continue.
- The Time to Wait for Prompts expires, then fail the operator.
- Determine if the operator is set to Run Commands as Another User:
- If so, go to step 6.
- If not, go to step 7.
- Send the Switch User Command and then do the following:
- Read from the Telnet session until one of the following occurs:
- You match the pattern specified in Switch User Password Text Prompt.
- You match the pattern specified in Switch User Command Prompt.
- The Time to Wait for Prompts expires.
- Take one of the following actions, based on the outcome:
- The Run Telnet Command operator has logged in and switched the user, if applicable. The operator is now ready to execute the commands.
- Loop through the commands, send one command at a time, and read from the Telnet session until one of the following occurs:
- You match the pattern specified in User Command Prompt (if we did not switch to another user). Repeat step 8 and send the next command.
- You match the pattern specified in Switch User Command Prompt (if we switched to another user). Repeat step 8 and send the next command.
- The Time to Wait for Prompts expires without matching the User Command Prompt or the Switch User Command Prompt (whichever is applicable). Fail the operator.
Copyright © 2014 CA.
All rights reserved.
 
|
|