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

Compare with Current View Page History

« Previous Version 22 Next »

FEATURE AVAILABILITY STARTING FROM RELEASE 1.9

Mode Of Operation

The SOSSSHJob2JSAdapter can run with either the Trilead implementation (default) or the JSch implementation by JCraft.

The JSch implementation for SSH connections adds the use of return values to the already existing functionality of the SOSSSHJob2JSAdapter class.

To use the JSch implementation you have to configure the following parameter in the params section of the scheduler.xml.

<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. 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 that temporary file on the remote host, returns them to the Jobscheduler for further processing and deletes the temporary file afterwards.

passing variables back to the JobScheduler

To use this feature you have to make sure that your command or command script writes the key-value-pair you want to have passed back to the JobScheduler, to the temporarily created file.

example

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.

New Parameters

general information

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: 
    • export %1s=%2s
  • description: 
    • The command to set an environment variable. The values for placeholders 1 and 2 will be set implicitly at the start of the job execution. The placeholders are mandatory.

postCommandRead

  • format: 
    • <command> <placeholder>
  • default value: 
    • cat %s
  • 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 during the job execution. 

postCommandDelete

  • format: 
    • <command> <placeholder>
  • default value: 
    • rm %s
  • description:
    • The command to delete the temporary file with the return values. The placeholder will be substituted during the job execution. 

Configuration

To use the return-values-feature configure a SSH job with JOE and choose SOSSSHJob2JSAdapter

 

For known limitations using the SSH Job to connect to a Windows Remote Host see Limitations when using SSH jobs for Windows.

Known Issues

Connecting over SSH

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
    • bcprov-jdk15on-152.jar

    • bcprov-ext-jdk15on-152.jar

  • 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:

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

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.

 

 

 

  • No labels