SSH Remote Command

Discover more about the SSH Remote Command component and how to use it on the Digibee Integration Platform.

SSH Remote Command allows a connection with an SSH server to be established and shell scripts to be executed.

Parameters

Take a look at the configuration options for the component. Parameters supported by Double Braces expressions are marked with (DB).

Messages flow

Input

No specific input message is expected.

Output

When executing an SFTP component using the download, upload, or move operations, the following JSON structure will be generated:

{
    "stdout": "xpto",
    "stderr": "xpto_err",
    "stdoutFileName": "stdout.txt",
    "stderrFileName": "stderr.txt",
    "success": "true"
}
  • stdout: successful response of the script execution.

  • stderr: response with errors of the script execution.

  • stdoutFileName: file path saved with the information displayed in stdout. This property will be displayed only if the Stdout As File flag is enabled.

  • stderrFileName: file path saved with the information displayed in stderr. This property will be displayed only if the Stderr As File flag is enabled.

  • success: "true" if there’s been a connection and the script has been executed, even if errors in stderr were returned.

Output with error

{
 "success": false,
 "message": "Could not execute the SSH remote command",
 "error": "java.net.SocketTimeoutException: connect timed out"
}
  • success: “false” when the operation fails.

  • message: a message about the error.

  • exception: information about the occurred error type.

The file manipulation inside a pipeline occurs in a protected way. The files are available in a temporary directory that only the pipeline being executed has access to.

To better understand the messages flow in the Digibee Integration Platform, read the Messages processing article.

SSH Remote Command in Action

Executing a script and receiving the information in the component JSON answer

Hostname: <HOST>

Port: <PORT>

Command: echo $MYNAME && echo error output >&2

Environment Variables: [{"key":"MYNAME", "value":"TEST"}]

Stdout As File: disabled

Stderr As File: disabled

Fail On Error: disabled

Result:

{
    "stdout": "TEST",
    "stderr": "error output",
    "success": "true"
}

Executing a script and saving the information in files

Hostname: <HOST>

Port: <PORT>

Command: echo $MYNAME && echo error output >&2

Environment Variables: [{"key":"MYNAME", "value":"TEST"}]

Stdout As File: enabled

Stdout File Name: stdout.txt

Stderr As File: enabled

Stderr File Name: stderr.txt

Fail On Error: disabled

Result:

{
    "stdoutFileName": "stdout.txt",
    "stderrFileName": "stderr.txt",
    "success": "true"
}

Last updated