Redwood Documentation

Product Documentation

 

›Agent Definition Types

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
← Using the CSH Definition TypeUsing the Python Definition Type →

Using the Perl Definition Type

Perl is a widely used, multi-platform scripting language. Redwood Server includes two Perl definition types, one of which uses unicode UTF-8 encoding for the source.

note

You must assign at least one process server to run PERL process definitions in order to use the definition type.

A Perl interpreter needs to be installed on the system that the platform agent runs on. On UNIX systems it should be installed as /usr/bin/perl. On Microsoft Windows systems the Perl interpreter will be found via the %PATH% environment variable. For the Perl process definitions type to work properly the version should be 5.8.2 or higher.

Interpreter

By default, the interpreter for PERL scripts defaults to /usr/bin/perl -w. You can override this by specifying an interpreter on process server-level with the LocalInterpreter_PERL or LocalInterpreter_PERLUNICODEprocess server parameter, like /usr/local/bin/perl -w, for example. You can also specify a list of allowed interpreters on process server-level using the InterpreterWhitelist_PERL or InterpreterWhitelist_PERLUNICODEprocess server parameter and override the default interpreter on process definition-level with the parameter JCS_INTERPRETER_PERL. Simply create the parameter and point it to your preferred interpreter, it must exist and be white-listed using the InterpreterWhitelist_PERL process server parameter.

The InterpreterWhitelist_PERL process server parameter takes a regular expression that must match the value of the JCS_INTERPRETER_PERL parameter.

Variables and Parameters

  • Parameters to the script are manipulated in the PERL source simply as if they are variables, using the standard $PARAMETER syntax.
  • Perl is a weak type-casted language; it only supports a single scalar data type: scalar. This maps directly for strings and numbers, but dates are subject to format conversions; see Scripting Date Formats.
  • Out parameters are supported. Set the variable using any Perl method. For example a simple assignment in Perl is $PARAMETER = VALUE;.
  • Array parameters are supported provided your PERL interpreter supports arrays. Arrays must have unique elements.

Returning an Error

If your script code exits with a non-zero exit code this is correctly reflected in the server. Note that the maximum value that can be returned is operating system dependent; we recommend not relying on more than one byte (0..255).

Perl Examples

The following shows how to use a built-in and an environment variable as well as parameter:

print "Hello from " . $^O . "!\n";            # built-in variable
print "OS user = " . $ENV{USER} . "\n";       # environment variable
print "Your message was " . $message . "\n";  # parameter

Match one variable to a pattern, the following process definition needs two string parameters defined: str and pattern.

if ($str =~ m/$pattern/)
{
  print "Match $i& found!\n";
}
else
{
  die "$str does not match $pattern...\n";
}

The following example shows you how to return a non-zero exit code resulting in the process going into Error:

{
  $N = 1;
  print "Exiting with exitcode $N.\n";

  return $N;

  print "Not reached.\n";
}

See Also

  • Platform Agent Definition Types
  • Command Line System Tools
← Using the CSH Definition TypeUsing the Python Definition Type →
  • Interpreter
  • Variables and Parameters
  • Returning an Error
  • Perl Examples
  • 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 |