Proxy commands

SSH, Kerberized SSH, and Telnet adapters can use a pass-through function for command execution that enables you to connect to a secondary target from the initial host by using Telnet or SSH. With this connection, you can execute commands on the secondary target.

Note

To use this functionality with SSH, you must use prompts. With unprompted SSH, each command is executed independently, not successively, as is needed to log on to the remote host.



Additional options assist the command execution on secondary targets. Commands issued on a secondary host can be contained in <command-group> tags.

The command has an optional attribute, verify-os, which you can use to obtain the operating system type and version on the secondary host. This is an important function if FAT commands are used and the operating system on the secondary system is different from the initial host.

The ignore-exit-code attribute of the <command> element prevents an exit code from being obtained after executing the command. By default, an exit code request is issued after each command. This can cause problems if the retrieval of an exit code is interpreted as a user name, password, prompt, or other input during the authentication process. You must use this attribute when the command that is automatically issued to obtain an exit code could be misinterpreted and would interfere with subsequent commands.

As with all <command> elements, the prompt attribute indicates the expected prompt returned on execution of the command. The subsequent command is executed at this returned prompt. Prompts specified in a <command> attribute are typically defined in a <prompts> block in the request.

If a prompt not defined in the <prompts> block is used as an attribute value for a <command>, the actual attribute value is used as the prompt. In the following example, if a value for prompt1 has not been defined in the <prompts> block, prompt1 is used as the prompt for the command:

<command prompt="prompt1">command 1</command>,

The following figure shows an XML sample of a request that uses the proxy command features.

XML sample of a request that uses the proxy command features

...
 <prompts>
   <prompt name="login">login:</prompt>
   <prompt name="password">password:</prompt>
 </prompts>
 <commands>
   <command prompt="login" ignore-exit-code="true">telnet test.target1.com
   </command>
   <command prompt="password" ignore-exit-code="true">user1</command>
   <command ignore-exit-code="true">pass1</command>
   <command-group verify-os="true">
   <command>cd /tmp</command>
   <command>ls \-al</command>
   <command>ps</command>
   <command>exit</command>
   </command-group>
   <command>exit</command>
 </commands>
... 
Was this page helpful? Yes No Submitting... Thank you

Comments