Remote Execution Action Plugin



Overview

This action plugin executes a script or executable on a remote node

Saved Parameters Description

This action allows the user to execute a script or executable on a remote node and grab one or more output variables.

  • Name: The name used to identify a saved RemoteExecution configured instance.
  • Comments: Comments associated to this template or configuration.
  • Time out: The time out after which the remote command exection will be terminated.
  • Standard I/O: This section allows to specify the reporting frequency for stderr and stdio, and whether the remote action outputs should be reported as an array if 'Is multiline?' is checked. If the output covers multiple lines and 'Is multiline?' is not checked, only the first line will be put into the stdio output variable.
  • Mandatory inputs: This section allows to specify the variables that the action will expose as mandatory inputs. An input variable can be accessed in the command line specification with the notation <%=variable_name%>
  • Optional inputs: This section allows to specify the variables that the action will expose as optional inputs. An input variable can be accessed in the command line specification with the notation <%=variable_name%>
  • Formatted outputs: This section allows to specify the values that the step will produce as outputs. Refer to the operation section to know how to specify the values.
  • Formatted outputs processing code: This section allows to specify the ruby code that will be executed once the remote command has completed. This code can access the standard output of the remote command execution via @outputs[VARIABLE_STDIO] if multiline is false or @outputs[VARIABLE_MULTILINE] if multiline is true; the exit code can be retrieved via @outputs[VARIABLE_EXITCODE]
  • Remote execution node: The remote node to execute the command from. List of already configured Remote Nodes.
  • Execution server address: The remote node address.
  • Use server address: Uses the provided server address instead of the remote node address.
  • Execution account: The user name and password to use for connecting to the remote server via SSH. If empty, take the login/password specified in the remote node.

Inputs Description

The run time inputs of this action depend on how the configuration is done. Variables exposed in the command line will be exposed as mandatory inputs.

  • Execution_node: The remote node to execute the command from.
  • Execution_login: The login name to access the remote node (optional).
  • Execution_password: The password to access the remote node (optional).

Outputs Description

This action executes the provided command line via an SSH session to the remote node.

  • exit_code: The exit code of the remote execution. If the exit code is different from 0, the plugin will return in error.
  • stdio: The standard output produced by the remote execution if multiline is false.
  • Multi: The standard output produced by the remote execution if multiline is true. It comes as an array, one entry per standard output line.

Additional outputs might be available depending on the step configuration.

Supported Actions

None

Dependencies

None

Operating Instructions

When a stdio frequency is provided, the standard output out of the executed command is streamed to the plugin status message. Otherwise it goes into the stdio output variable.

When a stderr frequency is provided, the standard error out of the executed command is streamed to the plugin status message. Otherwise it goes into the Orchestrator log file.

Status updates can be provided by the remote executable using the following output format:
'-#STATUS--#--STATUS MESSAGE#-'

Either STATUS or STATUS MESSAGE can be left empty.

Examples:
  • '-#Paused--#--Remote action was paused#-' -> would update the status and status message
  • '-#--#--File tester.txt was scanned successfully#-' -> would update just the status message
Example in a shell script:
echo "-#Paused--#--Remote action was paused#-"
Specified output variables will be extracted from the standard output if they follow the formatting below:
'-#OUTPUT:VARIABLE NAME--#--VARIABLE VALUE#-'
Example: '-#OUTPUT:size--#--120568#-' -> populates an output entry @outputs['size']=120568, if an output named size of type TYPE_INT is specified.
The following is an example of a shell script returning an error 2; output variable size; multiline true:
md5sum $1  | cut -d' ' -f1
echo "-#OUTPUT:size--#--120568#-"
echo "titi"
exit 2
The plugin outputs is the following:
size      120568
exit_code 2
Multi     ["45c2d08009be4a2307eddd4f0bd10a8f","titi"]

45c2d08009be4a2307eddd4f0bd10a8f is the md5 checksum for the file passed as first parameter of the shell script ($1)

Example of the same shell script returning an error 2; output variable 'size'; multiline false:

The plugin outputs will be:
size      120568
exit_code 2
stdio     45c2d08009be4a2307eddd4f0bd10a8f
          titi

For environment variables to be settable over SSH, the /etc/ssh/sshd_config must be modified first (on Isilon, the file is at /etc/mcp/templates/sshd_config), add a line at the end of the file to whitelist the env variable required:AcceptEnv [env_variable_1] [env_variable_2] [...] sshd must then be restarted for the changes to take effect.