Redwood Documentation

Product Documentation

 

›Command Line Tools

RunMyJobsPlatform Agents

External Platforms

  • Connecting Redwood Server to External Platforms

Credentials

  • Storing Credentials
  • Credential Protocols

Platform Process Servers

  • On-site Platform Process Servers
  • Cloud Platform Agents
  • Using the Wizard to Create Process Servers
  • Configuring Platform Agents
  • Spool Host Agents
  • The Environment of Platform Agent OS Processes
  • Processing Platform Processes
  • Process Server Services
  • Configuring Agentless Process Servers
  • Automatically Updating Platform Agents
  • Enabling TLS
  • Creating Monitoring Checks
  • Configuring Load Balancing on Platform Agents
  • Platform Agent Registry Entries
  • Monitoring Servers with Platform Process Servers

UNIX Agents

  • UNIX Process Servers
  • UNIX Process Server Configuration Data
  • File Events on UNIX
  • Creating UNIX Process Servers (Advanced)
  • Choosing a User Switching Security Mode
  • Controlling Unix Platform Agents
  • Uninstalling Redwood Server Platform Agents from UNIX

Windows Agents

  • Creating a Microsoft Windows Process Server
  • File Events on Microsoft Windows Process Servers
  • Configuration of a Microsoft Windows Process Server
  • Managed Services
  • Configuring Platform Agents on Microsoft Windows
  • Automating Windows tasks that require a desktop window
  • Uninstalling Redwood Server from Microsoft Windows

Agent Definition Types

  • Using the BASH Definition Type
  • Using the KSH Definition Type
  • Using the CSH Definition Type
  • Using the Perl Definition Type
  • Using the Python Definition Type
  • Using the PowerShell Definition Type
  • Using the Visual Basic Script Definition Type
  • Using the CMD Definition Type
  • Using the R Process Definition Type
  • Using the DCL Definition Type
  • Using Platform Definition Types
  • Using the OS Native Definition Type
  • Microsoft Windows Definition Types
  • Using the SQLPLUS Definition Type
  • Using the FTP Definition Type
  • Using the Groovy Definition Type

Command Line Tools

  • Command Line System Tools
  • jtool
  • jcat
  • jdescription
  • jevent
  • jecho
  • jftp
  • JFTP Return Codes
  • jgetcredential
  • jgetfile
  • jgetpar
  • jjoin
  • jlink
  • jlog
  • jmail
  • jmessage
  • jmonitor
  • jputfile
  • jregister
  • jrfc
  • jscp
  • jtool screenshot
  • jscript
  • jsecret
  • jsleep
  • jsplit
  • api-tool.jar

OpenVMS Process Servers

  • Creating HP OpenVMS Process Servers
  • Installing the Platform Agent on HP OpenVMS
  • Configuring HP OpenVMS Process Servers
  • File Events on HP OpenVMS
  • HP OpenVMS Definition Types

AS/400 Connector

  • IBM AS/400 Connector Architecture
  • Setting up the IBM AS/400 Connector
  • Creating an IBM AS/400 Process Server
  • Files on AS/400 Raise Events
  • Using the AS/400 Definition Type
  • Redwood Server OS Support
  • IBM z/OS Definition Types
  • Using the JCL_FTP Definition Type
  • IBM z/OS System Tools

Reference

  • Balancing the Load
  • Credential Protocols
← jeventjftp →

jecho, jtool echo

A platform agent tool used to send messages to STDOUT, similar to the echo command, with the added benefit of being able to decrypt passwords, passphrases and print process server parameter values.

Syntax

jecho [-h|-?|-help] [-l <loglevel>] [-f <logfile>] [-j|-job-context] [-log]
      [-log-with-level <loglevel>] [<message>] ...
ArgumentDescription
-base64Echo output encoded in base64.
-f <logfile>Log to file instead of stdout.
-fix-pemFixes newlines in PEM formatted keys when those are sent with spaces instead.
-h,-?,-helpShow this help and exit.
-j, -job-contextRun the command in job-context.
-l <loglevel>Set the logging level.
-logWrite to stdout in standard log format.
-log-with-level <loglevel> INFOSet loglevel for -log option.
-nSuppress newlines, equivalent to echo -n on UNIX.
<message>Message text

Environment Variables and Process Server Parameters

The jecho command allows you to print out process server parameter values and environment variables. The special ${LISTALL} variable contains a list of all environment variable and process server parameters. Any process server parameter that has remote set to true can be accessed in this way. Note that these must use the ${<name>} syntax in all interpreters and you must ensure that the interpreter does not attempt to evaluate them. Note that a number of interpreters including Bash, KSH, CSH, and PowerShell will attempt to evaluate the variable, you should enclose it in single quotes:

jtool echo -j '${DataRootDirectory}'

This can be used outside of job-context, however, only environment variables are available.

note

jecho expects a correctly escaped [environment] variable name for your shell, you must ensure the shell does not evaluate the variable. Numerous examples are available below.

Decrypting Passwords

Jecho can decrypt externally available credential passwords. You use =Credential.getProtectedPassword('MY_ENDPOINT', 'MY_USER') to retrieve the encrypted credential password. You specify the parameter containing the encrypted password using the ${<parameter_name>} syntax; this needs to be appropriately escaped for the shell.

The following Bash example needs a process definition parameter named MyPassword containing the encrypted password, using =Credential.getProtectedPassword('MY_ENDPOINT', 'MY_USER') for example:

jtool echo -j -n '${MyPassword}'

Example

Print a Message

An example Microsoft Windows CMD script to show how you can log errors in output files. Alternatively, you use jmessage to create operator messages.

dir g:
if errorlevel 1 jecho "Drive G: not accessible!"
Decrypting PEM Passwords

An example Bash script to test a PEM key stored in a parameter. If the PEM key is stored in a credential, you can use =Credential.getProtectedPassword('MY_ENDPOINT', 'MY_USER') to retrieve it, the jtool echo command will decrypt the password.

jtool echo -j -out -fix-pem '${MY_PASSWORD}' > my_password.txt
if grep -q - '--BEGIN' my_password.txt
then
  echo "Testing for PEM key validity"
  openssl rsa -modulus -in my_password.txt
fi

An example Windows BATCH (CMD) example of the above, note that the Windows Batch (CMD) script does not need to escape the ${MY_PASSWORD}.

jtool echo -j -fix-pem ${MY_PASSWORD} > my_password.txt

findstr /C:"-----BEGIN" my_password.txt 2>&1 >nul && (
  echo "Testing for PEM key validity"
  openssl.exe rsa -modulus -in my_password.txt
)
Decrypt Credential Passwords

A CMD example to decrypt a password retrieved from an externally available credential and pipe it to mycommand:

jecho -j -n "${MyParam}" | mycommand

A Bash example to decrypt a password retrieved from an externally available credential and pipe it to mycommand:

jtool echo -j -n '${MyPassword}' | mycommand
List All Process Server Parameters and Environment Variables with values

Windows CMD example:

for /f  %%i in ('jtool echo -j "${LISTALL}"') do (
for /f "tokens=*" %%j IN ('jtool echo -j "${%%i}"') DO echo %%i=%%j
)
note

In the example above, we specify tokens=* in the second loop as the value may contain spaces and or TAB characters.

In Bash

for i in $(jtool echo -j '${LISTALL}')
do
  echo "$i = $(jtool echo -j '${'$i})"
done

In PowerShell

foreach ($i in $(jtool echo -j '${LISTALL}'))
{
  $i + "=" + $(jtool echo -j `$`{$i`})
}
Generate base64 encoded credentials for Authorization Headers
CREDS=$(jecho -base64 "${Username}:${Password}")
for /f %%i in ('jecho -base64 "%Username%:%Password%"') do set CREDS=%%i

See Also

  • jmessage, jtool message
  • Command Line System Tools
← jeventjftp →
  • Syntax
  • Environment Variables and Process Server Parameters
  • Decrypting Passwords
  • Example
  • See Also
Docs
Getting StartedInstallationFinance InstallationConcepts
TroubleshootingArchiving
Learn and Connect
Support Portal
BlogEventsResources
ISO/ IEC 27001 Information Security Management
Automate to be human

2023 All Rights Reserved |

Terms of Service | Policies | Cookies | Glossary | Third-party Software | Contact | Copyright | Impressum |