Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

  • The JS7 - JITL SSH job allows

...

  • execution of shell commands and scripts on a remote host running an SSH server without requiring a local SSH client to be installed.
  • To log in to remote systems using a pair of keys.

...

  • in this example we added the client's public key to the remote server

...

  • with the authorized_keys file in the .ssh/

...

  •  sub-directory

...

  • of the target account's home directory

...

  • .

Workflow

The

...

11_AgentlessScheduling folder includes

...

two workflows

...

that use the JITL com.sos.jitl.jobs.ssh.SSHJob

...

 class with the

...

arguments host, port, auth_method, command

...

 etc. to login

...

to the SSH

...

server:

  • jdSSHPublicKeyAuthentication: In this workflow, the command parameter is used to execute a single command on the remote server. 
  • jdSSHScriptPublicKeyAuthentication: In this workflow, the command_script parameter is used to run

...

  • a full-blown script on the remote server. You can

...

  • add the contents of a shell script

...

  • to the command_

...

  • scriptparameter it will execute the

...

  • script on the remote server.

To execute the workflow from the 11_AgentlessScheduling folder follow the below steps:

  1. Click on

...

  1. the 11_AgentlessScheduling folder and expand any of the workflows

...

  1. The following examples uses jdSSHScriptPublicKeyAuthentication.

    Image Modified

  2. To add an order to the workflow, click the action menu of the workflow and select Add Order from the drop-down menu.

    Image Modified


  3. When clicking Add Order a popup window will appear.
  4. You can add an Order ID or leave the Order ID value empty, it will then use a default Order ID. Click the Submit button.

    Image Modified

  5. To check the status of the order click the name of the workflow. This will make the Order History panel appear.

    Image Modified

  6. From the Order History panel, you can verify that the order is successful and finished. Click the Order ID to see the log output created by jobs executed for this order.

    Image Modified

  7. A log view window will open and the order log will be displayed. This log contains the output of all jobs executed by the order. You can see the remote hostname for the SSH server is displayed. 
  8. You can download the log file by clicking the Download button from the upper right corner of the log view window. Also, you can expand and collapse the individual job output using the chevron icons from the left upper corner of the log view window.

    Image Modified