You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Current »

Introduction

  • The JS7 - JITL SSH job allows execution of shell commands and scripts on a remote host running an SSH server without the need of a local SSH client to be available.
  • To log in to remote systems using a pair of public/private 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 argument is used to execute a single command on the remote server. 
  • jdSSHScriptPublicKeyAuthentication: In this workflow the command_script argument is used to run a full-blown script on the remote server. You can add the contents of a shell script to the command_script argument that will execute the script on the remote server.

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

  1. Click on the 11_AgentlessScheduling folder and expand any of the workflows The following examples uses jdSSHScriptPublicKeyAuthentication.



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




  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.



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



  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.



  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.


  • No labels