Send Commands and Receive Response

If you try to run two policies containing SSH objects at the same time, then unexpected errors can occur. For example, the first policy can send commands in the SSH session created by the second policy. These errors occur because a class which handles the SSH connection is static.

Send specified command to the device and wait for the defined excepted output. Use Open Session object before using this object.

If this Object is used in an Automation Manager Policy that attempts to connect to a target device that is configured to use only SSH-2, the Policy may fail as the connection can be refused due to an invalid server version string error. This error will not occur for target devices that are configured to use only SSH-1 or to use either SSH-1 or SSH-2.

Input Parameters

Name Type Required Description
SSH Session Id String Yes Unique identifier of SSH session. Must be linked to SSH Session Id parameter returned by Open Session object.

Command to Run

String

Yes

The command to be sent to the device. Commands must be sent one at a time.

Timeout (sec) Number Yes Specify how long Automation Manager should wait for the command to complete. The default value is 60 seconds.

Expected Output (to stop receiving)

String

Yes

Capture output until specified line is received (example devicename#).

Output Parameters

Name Type Description

SSHOutput

String

The Output produced from sending the specified command

Result

Number

Returns a success value of zero or any value other than zero to indicate failure.

Result String String Object execution error details.

Example Input Parameters

Name Type Required Example
SSH Session Id String Yes  

Command to Run

String

Yes

Show Run

Config T

Timeout (sec) Number Yes 45

Expected Output (to stop receiving)

String

Yes

<hostname>#

SELABASA#