Introduction
Unix based operating systems generally provide an SSH client, while Windows operating systems by default do not.
The JobSchedulerSSHJob allows the execution of shell commands and scripts on a remote host running an SSH server without requiring a local SSH client to be installed.
This document describes the functionality of the JobSchedulerSSHJob and the arguments to configure the Job. Additionally this document provides a minimal example of an SSH Job configuration.
Usage
When defining the job consider
- to select the JITL job class and
- to specify the
com.sos.jitl.jobs.ssh.SSHJob
Java class name.
Example
A minimal SSHJob configuration can look like this:
Arguments
- Required Arguments
- Arguments that have to be set in the job configuration to run the job
- Example: The
host
argument is required to run a job that connects to a remote host.
- Example: The
- Arguments that have to be set in the job configuration to run the job
- Optional Arguments
- Arguments that are not required or arguments that are technically required but are available from a default value.
- Example 1: technically required, but available from default value
- To connect to a remote host, the
port
arguments is required. The arguments is available from the default value22
, therefore theport
argument does not have to be specified with the job arguments.
- To connect to a remote host, the
- Example 2: not required
- The
proxy_host
argument is used only if the job's connection makes use of a proxy.
- The
- Example 1: technically required, but available from default value
- Arguments that are not required or arguments that are technically required but are available from a default value.
The com.sos.jitl.jobs.ssh.SSHJJob
class accepts the following arguments:
Name | Required | Default Value | Purpose | Example |
---|---|---|---|---|
host | yes | specifies the hostname or IP address of the SSH server to which a connection is to be made. | ||
| yes | specifies the user account to be used when connecting to the SSH server. | ||
port | no | 22 | specifies the port number of the SSH server. | |
auth_method | no | publickey | This argument specifies the authorization method for the SSH server - the publickey and password methods are supported. The path name of the private key file must be set in the | |
password | no | This argument specifies the user account password for authorization by the SSH server and must be specified if the password authorization method is specified in the | ||
auth_file | no | This argument specifies the path and name of a user's private key file used for registration on an SSH server. This argument must be specified if the publickey authorization method has been specified in the | ||
command_delimiter | no | %% | Command delimiter characters are specified using this argument. These delimiters are used in command arguments to separate multiple commands. These commands can then executed in separate SSH sessions. | |
command | no | This argument specifies a command that is to be executed on the SSH server. Multiple commands can be separated by the command delimiter that is specified using the | ||
command_script | no | This argument can be used as an alternative to | ||
command_script_file | no | This argument can be used as an alternative to The SSH Job is able to transfer a command script file to the remote machine only if SFTP is allowed on the remote SSH Server. | ||
proxy_host | no | The value of this argument is the host name or the IP address of a proxy used to create the connection to the SSH server. The use of a proxy is optional. | ||
proxy_port | no | This argument specifies the port number of the proxy if a proxy is used to create the connection to the SSH server. | ||
proxy_user | no | The value of this argument specifies the user account for authorization by the proxy server if a proxy is used to connect to the SSH server. | ||
proxy_password | no | This argument specifies the password for the proxy server user account if a proxy is used to connect to the SSH server. | ||
command_script_param | no | This argument contains a argument string which will be appended when a | ||
ignore_error | no | false | If the value of this argument is set to true then execution errors caused by commands on the SSH server will be ignored. Otherwise such execution errors for jobs and orders are reported by the Job Scheduler. | |
ignore_exit_code | no | This argument is used to specify one or more exit codes which will not be treated as errors. Multiple exit codes can be defined using comma separated values or using ranges. |
| |
ignore_signal | no | If the value of this argument is set to true then all signals on Unix systems that terminate the execution of a command on the SSH server will be ignored - if for example a command is terminated using kill. | ||
ignore_stderr | no | This job checks if any output to | ||
simulate_shell | no | If this value is set to true then a login to a shell is simulated to execute commands. Some scripts may cause problems if a shell is not present. | ||
simulate_shell_prompt_trigger | no | The expected command line prompt. Using this prompt the job tries to find out if commands may be entered or have been carried out. If no prompt can be configured, timeout arguments have to be used. | ||
simulate_shell_inactiity_timeout | no | If this argument is set the job will assume that the command has been carried out and the shell is waiting for commands if no new characters are written to |