Display feature availability |
---|
|
Status |
---|
colour | Yellow |
---|
title | DRAFT |
---|
Mode Of Operation
The JobScheduler JITL SSH job uses either an SSH implementation from Trilead or, starting with JobScheduler version 1.9, an implementation of JCraft's JSch.
JSch is the default implementation for the JITL SSH job from JobScheduler version 1.10 onwards. The Trilead SSH implementation will not be supported from JobScheduler version 1.12 and removed later.
The JSch implementation for SSH connections The SOSSSHJob2JSAdapterJcraft uses the JCraft Framework for SSH connections and adds the use of return values to the already existing functionality of the JobSchedulerSSHJob.
To use the JSch implementation in JobScheduler Version 1.9.x you have to configure the following parameter in the params section of the SOSSSHJob2JSAdapter class.the scheduler.xml
, in newer versions you don´t have to configure this parameter.
If you still want to use the Trilead SSH implementation in versions 1.10 and newer, change the parameter value shown below to false.
Code Block |
---|
|
<param name="jitl.ssh.use_jsch_impl" value="true"/> |
The Job sets an environment variable to the session on the remote host with the name "SCHEDULER_RETURN_VALUES" which is available for the script or command to be executed on the remote machine. After . The value (the name of the temporary file) for this environment variable will be generated at runtime. After the execution of the script or command the jobs reads the return values from a that temporary created file on the remote host, returns them to the Jobscheduler for further processing and deletes the temporary file afterwards.
New Parameters
.
Jira |
---|
server | SOS JIRA |
---|
serverId | 6dc67751-9d67-34cd-985b-194a8cdc9602 |
---|
key | JITL-112 |
---|
|
Jira |
---|
server | SOS JIRA |
---|
columns | key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution |
---|
serverId | 6dc67751-9d67-34cd-985b-194a8cdc9602 |
---|
key | JITL-123 |
---|
|
Jira |
---|
server | SOS JIRA |
---|
columns | key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution |
---|
serverId | 6dc67751-9d67-34cd-985b-194a8cdc9602 |
---|
key | JITL-151 |
---|
|
Jira |
---|
server | SOS JIRA |
---|
columns | key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution |
---|
serverId | 6dc67751-9d67-34cd-985b-194a8cdc9602 |
---|
key | JITL-446 |
---|
|
Jira |
---|
server | SOS JIRA |
---|
columns | key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution |
---|
serverId | 6dc67751-9d67-34cd-985b-194a8cdc9602 |
---|
key | JITL-449 |
---|
|
To use this feature you have to make sure that your command or command script writes the key-value-pair, which you want to have passed back to the JobScheduler, to the temporarily created file.
The command echo MYPARAM=myTestParam >> $SCHEDULER_RETURN_VALUES
writes MYPARAM=myTestParam
to the temporary file defined by the environment variable $SCHEDULER_RETURN_VALUES
.
The environment variable will be set implicitily during the job execution.
...
The default values use the linux bash syntax. These parameters have to be set only if running on systems using a different syntax than the linux bash syntax. Please choose the format of the command value and it placeholders according to the operating system on the remote host.
preCommand
- format:
<
command> <placeholder1> = <placeholder2>
- default value:
- description:
- The command to set an environment variable. The values for placeholders 1 and 2 will be set implicitly through at the start of the job execution. The placeholders are mandatory.
postCommandRead
- format:
- default value:
- description:
- The command to read the temporary file where the return values are written to through the script/command execution of the SSH job. The placeholder will be substituted through during the job execution.
postCommandDelete
- format:
- default value:
- description:
- The command to delete the temporary file with the return values. The placeholder will be substituted through during the job execution.
Configuration
- type
- description:
- This parameter is used to set the path of tte remote folder where the user has write privileges.
- if the parameter is not set the default working dir of the SSH session is used.
The SSH Job always tries to detect the remote OS and assumes the remote shell. The preCommand
, postCommandRead
and postCommandDelete
parameters will be set automatically.
- type
- description:
- If set to
false
this parameter deactivates the automatic setting of the above mentioned parameters, detection of the remote OS and shell will be carried out and logged regardlessly.
- default value:
Image AddedThe SOSSSHJob2JSAdapterJcraft
job will replace the existing SOSSSHJob2JSAdapter
Job in future releases.
To use the return-values-feature configure a SSH job with JOE and choose SOSSSHJob2JSAdapterJcraft
JobSchedulerSSHJob
.
Image Removed...
for the JobScheduler SSH Job | | Example for the JobScheduler SSH Job |
---|
|
Code Block |
---|
language | xml |
---|
title | Order Job storing a key/value pair on the remote host |
---|
collapse | true |
---|
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<job name="setValueRemote" title="Launch remote commands or executable files by SSH" order="yes" stop_on_error="no">
<description >
<include file="jobs/JobSchedulerSSHJob.xml"/>
</description>
<params >
<param name="host" value="HOSTNAME"/>
<param name="port" value="22"/>
<param name="user" value="USERNAME"/>
<param name="password" value="PASSWORD"/>
<param name="auth_method" value="password"/>
<param name="command" value="echo ADD='Hallo Welt' >> \$SCHEDULER_RETURN_VALUES"/>
</params>
<script language="java" java_class="sos.scheduler.job.SOSSSHJob2JSAdapter"/>
<run_time />
</job> |
Code Block |
---|
language | xml |
---|
title | Order job reading the returned value(s) |
---|
collapse | true |
---|
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<job order="yes" name="getValue">
<params />
<script language="shell">
<![CDATA[echo %SCHEDULER_PARAM_ADD%]]>
</script>
<run_time />
</job>
|
Code Block |
---|
language | xml |
---|
title | Jobchain to write value(s) remote and read the returned Scheduler parameters |
---|
collapse | true |
---|
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<job_chain name="test_return_values">
<job_chain_node state="WRITE_VALUE_REMOTE" job="setValueRemote" next_state="READ_VALUE" error_state="ERROR"/>
<job_chain_node state="READ_VALUE" job="getValue" next_state="SUCCESS" error_state="ERROR"/>
<job_chain_node state="SUCCESS"/>
<job_chain_node state="ERROR"/>
</job_chain>
|
For known limitations using the SSH Job to connect to a Windows Remote Host see Limitations when using SSH jobs for Windows.
Sometimes while connecting an error occurs which states "java.security.InvalidAlgorithmParameterException: Prime size must be multiple of 64, and can only range from 512 to 2048 (inclusive)".
This Java-Security issue is documented as a bug here and here.
To workaround this issue you can do as follows:
- First download the following jars from BouncyCastle at https://www.bouncycastle.org/latest_releases.html
- Copy those jars to your
${JAVA_HOME}/jre/lib/ext/
folder - Edit the
${JAVA_HOME}/jre/lib/security/java.security
properties file- Add the JCE provider you’ve just downloaded
- Search for
security.provider
in the configuration and add the BouncyCastleProvider as the second provider
After the changes your configuration should look like this:
Code Block |
---|
language | bash |
---|
title | java.security |
---|
|
security.provider.1=sun.security.provider.Sun
security.provider.2=org.bouncycastle.jce.provider.BouncyCastleProvider
security.provider.3=sun.security.rsa.SunRsaSign
security.provider.4=sun.security.ec.SunEC
security.provider.5=com.sun.net.ssl.internal.ssl.Provider
security.provider.6=com.sun.crypto.provider.SunJCE
security.provider.7=sun.security.jgss.SunProvider
security.provider.8=com.sun.security.sasl.Provider
security.provider.9=org.jcp.xml.dsig.internal.dom.XMLDSigRI
security.provider.10=sun.security.smartcardio.SunPCSC |
Note |
---|
Make sure to add the BouncyCastleProvider as the second Provider and adjust the numeration. - If you add the Provider as the first, the default Java JCE can be broken.
- If you add the Provider as the last one, it can happen that Java doesn´t recognizes it.
|
...
Jira |
---|
server | SOS JIRA |
---|
columns | type,key,issuelinks,fixversions,status,priority,summary,updated |
---|
maximumIssues | 20 |
---|
jqlQuery | labels in (ssh) |
---|
serverId | 6dc67751-9d67-34cd-985b-194a8cdc9602 |
---|
|
Image Removed