UAC Utility: Run a Command/Script on a Remote SSH Server

Disclaimer

Your use of this download is governed by Stonebranch’s Terms of Use, which are available at  Stonebranch Integration Hub - Terms of Use.

Overview

Universal Task to run a command or Universal Controller "data" script on a remote ssh server. 

Enables the execution of commands and scripts from the Universal Controller script library on a remote Unix. Linux, or Windows SSH server.  

  • The Universal Task will end with the exit code from the remote command / script.
  • Both stdout and stderr from the remote task are returned to the Universal Task's stdout. Stderr is used for messages from the Universal Task itself.
  • Requires Python 3.6 or higher with the ssh2-python module installed. Tested with the Universal Agent bundled Python distribution.
  • You can set different log-levels for the Universal task, providing you more or less information to suit your needs.

An SSH task is unable to provide the following functionality that is available for tasks that execute on a Universal Agent.

  • No Agent visibility, status, or alerting is available
  • The remote command or script cannot be cancelled from the controller UI, cancelling the SSH task will only cancel the Universal Task Python script that is initiating the SSH session
  • No fault tolerant functionality
  • No clustering, load balancing, or broadcast functionality 

The Universal Task performs the following:

  1. Connects to the Remote SSH Server
  2. Authenticates to the Remote SSH  Server via Userid and Password or SSH Public Key.
  3. Execute Command on SSH Server or Transfer UC Data Script to Remote SSH Server and Execute.  


Version Information

Template Name

Version

SSH

1 (Current 1.0.2)

Refer to Changelog for version history information.


Example Output


Universal Task Details Fields


Field Label

Description

Example

Required

Remote SSH Server

Specify the Hostname for the Remote SSH Server

mysshserver

Y

Remote SSH Port

Specify the SSH port for the Remote SSH Server

22

Y

Remote SSH Credential

Select the Credential Definition to access the Remote SSH Server.  

If the Credential specifies a Key Location, Public Key Authentication will be performed.


Y

Command or Script 

Specify whether to execute a Command, or Transfer and Execute a UC Data Script.


Y

Command

Command To be Executed on the Remote SSH Server

ls -la

Y (If Command or Script = Command)

Script

UC Data Script to be transferred and Executed on the Remote SSH server


Y (If Command or Script = Script)

Changelog

ut-cs-remote-ssh-server-json-1.0.2 (2024-04-25)

Fixes

  • Fixed: Invalid file format when copied to a different OS (#36400)

  • Fixed: incorrect version name printed from within the script was corrected.

ut-cs-remote-ssh-server-json-1.0.1 (2022-06-23)

Fixes

  • Fixed: Migration from XML to JSON, missing input fields (#29222)

ut-cs-remote-ssh-server-json-1.0.0 (2022-05-10)

Migration of Universal Template from XML to JSON. First initial version of JSON Template compatible with 7.0.