Thank you for your feedback.
Form temporarily unavailable. Please try again or contact to submit your comments.
  • London
  • Kingston
  • Jakarta
  • Istanbul
  • Helsinki
  • Geneva
  • Store

SSH template inputs

SSH template inputs

You use the Inputs tab of the activity designer to create variables to pass into the activity.

You can test the SSH connection between the MID Server and the target host without having to run the activity in a workflow context. For details, see Test SSH activity template inputs.
Note: Variable strings in the Inputs tab have a 255 character limit.
Figure 1. SSH custom activity Inputs tab
Table 1. SSH activity inputs
Field Description
Input Input variable builder. Create variables to map to available fields.
Target host Host name or IP address of the target server for this activity.
Command Command this activity runs on the target host.

You can invoke a MID Server script from this field using any script type that is supported by the SSH command line. For more information, see Advanced SSH script options below the table.

Directory Directory on the target host where the command is run.
Credential tag The Orchestration credential tag to use when running the command.
Select MID Server by capabilities MID Server with the appropriate capabilities for connecting to the host. By default, the system selects a MID Server with SSH capabilities
Long running Check box to disable the SSH connection timeout for commands that might take longer to run than the default 60 seconds. Orchestration periodically checks the running process to determine its status until it is finished.
Must Sudo Check box to allow the use of sudo to run commands.

Advanced SSH script options:

To see the list of available MID Server scripts, navigate to MID Server > Script Files.

To run a MID Server script on the target host, specify the script type and pass the name of the script into the ${syncFile()} parameter. The system uses this parameter to locate the named script in the MID Server Script File [ecc_agent_script_file] table and run it on the target host. For example, a bash script can be expressed as bash ${syncFile("<MID script name>")} argument1 argument2 argument3. A simple example might be bash ${syncFile("hello.bash")} arg1 arg2 arg3.

In the following advanced example, a base script (main_script.bash) references another script (my_include.bash) as well as a separate file (.my_profile) located on the target host. Both scripts and the file referenced must be synced to the MID Server, using the ${syncFile()} parameter, to execute properly.

source ${syncFile(".my_profile")}
cp ${syncFile("my_include.bash")} /usr/ssmith/my_include.bash
bash ${syncFile("main_script.bash")} one two three four five six 
rm /usr/ssmith/my_include.bash

A Python example with inline comments might look like this:

set $LIB_DIR=/usr/bin;. 
# Sync a file that is referenced inside 
cp ${syncFile("")} ~/ 
# set up environment variables 
source ${syncFile(".python_profile")} 
# call script that sets up dependencies on the box from remote package repos 
python ${syncFile("")} pycontrol 
# call a script that requires functions from the package as well as a function from myIncludedFile 
python ${syncFile("")} snow_pool myActualValue 
# user is responsible for their own cleanup 
rm ~/