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 in the 11_AgentlessScheduling folder follow the steps described below:

  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. In the Order History panel, you can verify that the order is successful and has 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 in the upper right-hand corner of the log view window. Also, you can expand and collapse all the job output using the chevron icons in the upper left-hand corner of the log view window.


  • No labels