0% found this document useful (0 votes)
712 views

Perl DNI Guide

Perl DNI Guide

Uploaded by

Rajkumar Gs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
712 views

Perl DNI Guide

Perl DNI Guide

Uploaded by

Rajkumar Gs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

TIBCO Perl Directory Named Initiation (DNI)

Installation and Operations Guide


Software Release Build 118 Hotfix DX02008
August 2015
Important Information
SOME TIBCO SOFTWARE EMBEDS OR BUNDLES OTHER TIBCO SOFTWARE. USE OF SUCH
EMBEDDED OR BUNDLED TIBCO SOFTWARE IS SOLELY TO ENABLE THE FUNCTIONALITY
(OR PROVIDE LIMITED ADD-ON FUNCTIONALITY) OF THE LICENSED TIBCO SOFTWARE. THE
EMBEDDED OR BUNDLED SOFTWARE IS NOT LICENSED TO BE USED OR ACCESSED BY ANY
OTHER TIBCO SOFTWARE OR FOR ANY OTHER PURPOSE.
USE OF TIBCO SOFTWARE AND THIS DOCUMENT IS SUBJECT TO THE TERMS AND
CONDITIONS OF A LICENSE AGREEMENT FOUND IN EITHER A SEPARATELY EXECUTED
SOFTWARE LICENSE AGREEMENT, OR, IF THERE IS NO SUCH SEPARATE AGREEMENT, THE
CLICKWRAP END USER LICENSE AGREEMENT WHICH IS DISPLAYED DURING DOWNLOAD
OR INSTALLATION OF THE SOFTWARE OR IF THERE IS NO SUCH SOFTWARE LICENSE
AGREEMENT OR CLICKWRAP END USER LICENSE AGREEMENT, THE LICENSE(S) LOCATED
IN THE LICENSE FILE(S) OF THE SOFTWARE. USE OF THIS DOCUMENT IS SUBJECT TO
THOSE TERMS AND CONDITIONS, AND YOUR USE HEREOF SHALL CONSTITUTE
ACCEPTANCE OF AND AN AGREEMENT TO BE BOUND BY THE SAME.
This document contains confidential information that is subject to U.S. and international copyright laws and
treaties. No part of this document may be reproduced in any form without the written authorization of TIBCO
Software Inc.
TIBCO, The Power of Now, TIBCO Managed File Transfer, TIBCO Managed File Transfer Command
Center, TIBCO Managed File Transfer Internet Server, TIBCO Managed File Transfer Platform Server,
TIBCO Managed File Transfer Platform Server Agent, and Slingshot are either registered trademarks or
trademarks of TIBCO Software Inc. or its subsidiaries in the United States and/or other countries.
All other product and company names and marks mentioned in this document are the property of their
respective owners and are mentioned for identification purposes only.
THIS SOFTWARE MAY BE AVAILABLE ON MULTIPLE OPERATING SYSTEMS. HOWEVER, NOT
ALL OPERATING SYSTEM PLATFORMS FOR A SPECIFIC SOFTWARE VERSION ARE RELEASED
AT THE SAME TIME.
THIS DOCUMENT IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
THIS DOCUMENT COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL
ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION HEREIN; THESE
CHANGES WILL BE INCORPORATED IN NEW EDITIONS OF THIS DOCUMENT. TIBCO
SOFTWARE INC. MAY MAKE IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S)
AND/OR THE PROGRAM(S) DESCRIBED IN THIS DOCUMENT AT ANY TIME.
THE CONTENTS OF THIS DOCUMENT MAY BE MODIFIED AND/OR QUALIFIED, DIRECTLY OR
INDIRECTLY, BY OTHER DOCUMENTATION WHICH ACCOMPANIES THIS SOFTWARE,
INCLUDING BUT NOT LIMITED TO ANY RELEASE NOTES AND "READ ME" FILES.
TIBCO Managed File Transfer Internet Server with RocketStream Accelerator is entitled TIBCO
Managed File Transfer Internet Server in certain other product documentation and in user interfaces of the
product.
Copyright 2003-2015 TIBCO Software Inc. ALL RIGHTS RESERVED.
TIBCO Software Inc. Confidential Information
Contents

Introduction ............................................................................................................................. 4
RELATED DOCUMENTATION ................................................................................................................ 6
ENHANCEMENTS.................................................................................................................................. 7
FIXES ................................................................................................................................................... 9
KNOWN ISSUES.................................................................................................................................. 11
HOW TO CONTACT TIBCO CUSTOMER SUPPORT .............................................................................. 12
Installation and Operations ................................................................................................... 13
INSTALLING THE DNI UTILITY .......................................................................................................... 14
DNI HELP SCREENS .......................................................................................................................... 16
RUNNING THE DNI PERL SCRIPT ....................................................................................................... 17
FILE TOKENS ..................................................................................................................................... 21
DNI TEMPLATE PARAMETERS ........................................................................................................... 25
ENCRYPTING A DNI TEMPLATE PASSWORD ...................................................................................... 37
CONFIGURING DNI MANAGEMENT FOR COMMAND CENTER ............................................................ 39

TIBCO Perl Directory Named Initiation (DNI) User Guide


Introduction

Directory Named Initiation (DNI) allows MFT Platform Server to detect


the existence of files that have been placed within a directory and/or sub
directories and automatically transfer those files to one or more targeted
MFT Platform Server remote systems.

When you set up a DNI transfer, MFT Platform Server scans a pre-defined
local or remote directory at a user-defined interval. It will return and save
a list of all files in that directory. Any files that have changed between the
scans are eligible to be transferred. Since there is no standardized way of
locking files on UNIX, this is how MFT Platform Server can tell whether
the file is in use or not. When a file transfer is complete, DNI allows you
to delete the original file, move it to a new directory, or leave the file
where it is.

Transfer requests that can be processed using DNI are:

DNI Send
DNI Send reads the directory/s defined and executes a command
when it detects a file exists within the directory/s and sends the files
to a remote system.

DNI Receive
DNI Receive contacts a remote MFT Platform Server system to extract
a list of files in the directory defined. Based on this list, DNI Receive
will execute a command to transfer the files to the local machine.

DNI processing is done using a Perl script called dni. To support DNI your
system must have a version of Perl installed. The Perl program directory
should be defined in the PATH environment variable. If you do not have
Perl installed on your computer, it can be downloaded for free from web
site: www.perl.org.

TIBCO Perl Directory Named Initiation (DNI) User Guide


Note: The MFT Platform Server DNI Perl script will run on both Windows
and UNIX platforms and we provide DNI templates for both. The Perl DNI
templates for the Windows platform do not work with or complement the
MFT Platform Server for Windows (GUI) DNI feature in any way. For
information using MFT Platform Server for Windows (GUI) DNI, please
refer to the MFT Platform Server for Windows documentation.

There are many uses for DNI. For example:

1. To copy entire directory structures from one system to another -


You can tell MFT Platform Server DNI to copy all files from
SystemA to SystemB and create the same directory structure that
exists on SystemA on SystemB using the LocalFileName token. In
this example, the DNI template on SystemA can be configured
with the PPA SuccessAction set to leave, the write mode set to
CRN and SubDirectory parameter set to Yes for the directory
structure to be created. Note: It is important that the DNI is only
from SystemA to SystemB. A second DNI configured similarly to
copy from SystemB to SystemA could create an infinite loop.
2. Copy files to another MFT Platform Server computer. As DNI
detects that a file on SystemA has changed, DNI will send the file
to SystemB. In this case when the transfer has completed, you
can move the file to a backup directory, or delete the file.
3. Execute any UNIX or Windows command based on the existence
of a file. As DNI detects that a file on SystemA has changed, DNI
will execute a pre-defined command. This command can include
information on the local file that was the source of the DNI
request. It is up to the DNI Administrator to define the actual
command that is executed.
Topics

Related Documentation
How to Contact TIBCO Customer Support
Enhancements
Fixes
Known Issues

TIBCO Perl Directory Named Initiation (DNI) User Guide


Related Documentation

This section lists documentation you may find useful.

The following documents form the TIBCO MFT Platform Server


documentation set:
TIBCO MFT Platform Server for Window Users Guide
Read this manual for instructions on site preparation,
installation, and on using the product to perform transfer
requests and more between other Platform Server nodes.
TIBCO MFT Platform Server for UNIX Users Guide Read
this manual for instructions on site preparation,
installation, and on using the product to perform transfer
requests and more between other Platform Server nodes.
TIBCO MFT Platform Server Agent Installations and
Operations Guide Read this manual for instructions on
site preparation, installation, and on using the product to
perform transfer requests and more between other
Platform Server products.
TIBCO MFT Command Center Quick Start Guide Read this
manual for instructions on managing DNI scripts from and
MFT Command Center.

TIBCO Perl Directory Named Initiation (DNI) User Guide


Enhancements

This section lists the enhancements for this build of Perl DNI.

Enhancements included within Build 118 hotfix DX02008


PDNI-47 When DNI templates are created/updated from MFT Command Center the
passwords can be masked by setting the new DNIConfig parameter,
EncryptCmdPwd=Yes. Default value: No Valid values: Yes/No

Enhancements included within Build 116 hotfix DX01989


PDNI-36 Added the LeaveRetention parameter in the dni templates to control the size
of the leavefile. Entries that are older than the number of days specified will be
removed.
PDNI-24 Added the ability to turn scanning on and off multiple times in a single day.
PDNI-23 Add the Start parameter to the dni templates to give the ability to start a DNI
template with a hot, cold, or warm start. The default value is warm.
PDNI-15 Added a date and time stamp to the log file entries.
PDNI-14 Added the FileOrder parameter to the DNI templates to allow transfers to be
sorted in ascending or descending order based on modified date/time, size, file name,
or directory name/filename.

Enhancements included within Build 111 hotfix DX01969


PDNI-30 Added DirectoryRegex parameter to the DNI template.
PDNI-29 Added Retry action value for FailureAction and NetworkErrorAction
dispositions.

Enhancements included within Build 109


PNDI-16 FTP Receive capability has been added.
PDNI-4 A new parameter called LogDirectory has been added to the DNIConfig.cfg file.
This parameter defines the folder where the log files are written for each DNI template.
PDNI-2 The following new tokens have been added:

: $(RemoteFilePathLDir)

TIBCO Perl Directory Named Initiation (DNI) User Guide


: $(RemoteFilePathRDir)
: $(LocalFilePathLDir)
: $(LocalFilePathRDir)
: $(D01) - $(D16)
: $(F01) - $(F16)

TIBCO Perl Directory Named Initiation (DNI) User Guide


Fixes

This section lists the fixes addressed in this version of Perl DNI.

Problem Descriptions resolved within Build 118 hotfix DX02008


PDNI-56 Resolves a problem when DNI Receive is performed from zOS, a / is added to
start of remote file name.
PDNI-51 Resolves a problem where passwords are displayed in clear text when using
"/rw=" or "/RemotePassword=" on the DNICommand or RemoteCommand parameters.

Problem Descriptions resolved within Build 117 hotfix DX02001


PDNI-45 "dni" Template stops running when a user logs in and out of a Windows 2003
server.
PDNI-44 "DNIDaemon.pl" fails to stay running when started from korn shell and user
logs out.

Problem Descriptions resolved within Build 116 hotfix DX01989


PDNI-41 Error: "ps: illegal option -- o" is reported when DNIDaemon starts when it is
started on an HPUX system.
PDNI-38 Resolves a problem where CLI Passwords were displayed in clear text when
in Debug mode.

Problem Descriptions resolved within Build 112 hotfix DX01974


PDNI-34 If you define the FileFilter or FileREGEX parameter but not the
DirectoryREGEX parameter, no files will be selected.
PDNI-33 If the Daemon is stopped and started before a second scan of the scan
directory has taken place files will be sent a second time.
PDNI-31 File names with apostrophe fails for PPA or disposition to move.

Problem Descriptions resolved within Build 111 hotfix DX01969


PDNI-28 Added a new parameter to the DNI template: AuditDirectory: ./Audit
When this parameter is defined, an Audit file will be created each day that contains the
following information for each transfer and each Post Action executed (Move or Delete)
: Date Time

TIBCO Perl Directory Named Initiation (DNI) User Guide


: Function: Send | Receive | SuccessDelete | SuccessMove |......
: Return Code
: File name
: Message
PDNI-27 Resolved an issue where the DNICommand was truncated when the pound
sign (#) was used at the end of a PPA command.
PDNI-26 Added a new parameter to the DNI template: PostActionFail={Leave | Ignore }
If Leave is specified, the leave file will be updated when a Post Action move or delete
fails. The file will not be re-transmitted.
PDNI-17 Resolved an issue on Windows where files contained in a leave file were
resent when moving to Daylight Savings Time.
**Note, it is recommended that all files in the DNI folders be removed prior to applying
the patch. Any files left in the folder that were added during DST WILL be re-
transmitted one time after applying this update.
PDNI-12 Resolved a problem on Windows with the WMIC command which caused the
start the DNI process from MFT Command Center to fail with error: Invalid XSL format
(or) file name.

Problem Descriptions resolved within Build 109


PDNI-1 Resolved a problem were Perl DNI templates on Solaris systems could not be
started from Command Center 7.2.0.
PDNI-5 Resolved a problem where DNI Daemon displayed unwanted information at
startup.
PDNI-11 Resolved a problem where the local file was moved before the transfer
occurred when using the submit parameter with Perl DNI.

TIBCO Perl Directory Named Initiation (DNI) User Guide


Known Issues

This section lists the known issues for this build of Perl DNI.

Known Issues with Build 109


There is a known issue with PERL 5.16 on Windows that causes the PERL DNI
daemon to crash when attempting to manage it from MFT Command Center.

TIBCO Perl Directory Named Initiation (DNI) User Guide


How to Contact TIBCO Customer Support

For comments or problems with this manual or the software it


addresses, contact TIBCO Support, as follows:

For an overview of the TIBCO Support and information on


getting started with TIBCO Support, visit
http://www.tibco.com/services/support

If you already have a valid maintenance or support


contract, visit https://support.tibco.com

Entry to this site requires a user name and password. If


you do not have to login credentials, click Register with
Support.

Technical Support email address [email protected]

Technical Support Call Centers:

o North and South America: +1.650.846.5724 or


+1.877.724.8227 (1.877.724.TACS)
o EMEA (Europe, Middle East, Africa): +44 (0)
870.909.3893
o Australia: +61.2.4379.9318 or 1.800.184.226
o Asia: +61 2 4379 9318

TIBCO Perl Directory Named Initiation (DNI) User Guide


Installation and Operations

This section explains how to install and use the TIBCO Perl Directory
Named Initiation (DNI) program.

Topics

Installing the DNI Utility


Running the DNI Perl Script
Encrypting a DNI Template Password
Configuring DNI Management for Command Center
DNI Help Screens

TIBCO Perl Directory Named Initiation (DNI) User Guide


Installing the DNI Utility

DNI is distributed as a tar file called dni.tar. On a UNIX platform it


can be found in the (MFT Platform Server Install)/dni directory.
On a Windows platform it can be found in the (MFT Platform
Server Install) directory.
To extract the files on a UNIX platform execute the following tar
command:
tar xvf dni.tar
To extract the files on a Windows platform use a file expansion
utility, such as WinZip or 7-Zip.

Upon successful execution of this command, you will find the


following seven files:

File Name Description


dni The MFT Platform Server DNI Perl script
program
dnitemplate.psend The DNI template for UNIX DNI Send via MFT
Platform Server Agent.
dnitemplate.send The DNI template for UNIX DNI Send via MFT
Platform Server for UNIX
dnitemplate.recv The DNI template for UNIX DNI receive via
MFT Platform Server for UNIX
dnitemplate.recvftp The DNI template for UNIX DNI receive via
FTP
dnitemplate.wsend The DNI template for Windows DNI Send via
MFT Platform Server for Windows
dnitemplate.wrecv The DNI template for Windows DNI receive
via MFT Platform Server for Windows
dnitemplate.wrecvftp The DNI template for Windows DNI receive
via FTP
DNIConfig.cfg The configuration file which contains the

TIBCO Perl Directory Named Initiation (DNI) User Guide


settings to be used by the MFT Command
Center DNI perl script program.
DNIDaemon.pl The MFT Command Center DNI perl script
program
Perl Directory Named Installation and Operations guide to install
Initiation (DNI) and operate the Perl DNI program.
Installation and
Operations Guide.pdf

Note a few things about the dni template files:

1. Any data in a line after the # is a comment.


2. If a line consists of all blanks, the line is ignored.
3. All parameters are in the format of xxx: yyy where xxx is
the parameter name, and yyy is the parameter value.
4. Parameter names and values are not case sensitive,
although we suggest leaving them mixed case for easier
reading.
5. The LocalFileName (lf) and RemoteFileName (rf)
parameters must be specified in the DNI template. If you
specify a transfer template in your DNI template the
LocalFileName (lf) and RemoteFileName (rf) parameters
defined in the DNI template will override these values
defined in a transfer template.
6. The use of Distribution lists (the Platform Server list
parameter) is not recommended for use in DNI. This is
because if any transfer defined in the distribution list fails,
the entire send fails. Based on the defined failure option,
this may cause the entire distribution list to be
retransmitted.

TIBCO Perl Directory Named Initiation (DNI) User Guide


DNI Help Screens

There are five help screens that give information on how the MFT
Platform Server DNI script can be used. This can be executed by
entering the following commands:

perl dni help General help information


perl dni help template Template configuration
information.
perl dni help tokens Substitutable Token information
perl dni help encrypt Creates an encryption $(Password)
token
perl DNIDaemon.pl help Manage DNI Daemons for MFT
Command Center information

TIBCO Perl Directory Named Initiation (DNI) User Guide


Running the DNI Perl Script

Use the following command to execute the DNI Perl script:


perl dni t:dnitemplatename {optional parameters}

If dnitemplatename is not in the current working directory,


specify a fully qualified name.

DNI Script Optional Parameters:

Parameter Description
cold The Cold option bypasses the reading of the
Leave file that contains the list of files already
transferred that is saved when the SuccessAction
and/or FailureAction is set to leave. As defined
in the warm option description. As such, DNI will
transfer any file in the scan directory when the
script is started. This option should be used with
great care. Note: This parameter overrides the
start parameter in the MFT Platform Server
template.
warm This parameter is only used when a DNI
SuccessAction or FailureAction is defined as
Leave. Due to this DNI will keep track of files
that have been transferred and store the
information in a file. The warm option tells DNI to
read the Leave file and at start up and process
the files normally as if MFT Platform Server did not
come down. This makes sure that a file is not
transferred multiple times by mistake. (This is the
default when no option is set.) Note: This
parameter overrides the start parameter in the
MFT Platform Server template.
hot When defined, DNI will add all files detected on
the first directory scan to the Leave file.
Therefore the contents of the directory when DNI
is started will not be transferred. Note that a Hot
start creates the Leave file with the contents of
the directory after the first scan. If DNI Receive is

TIBCO Perl Directory Named Initiation (DNI) User Guide


Parameter Description
unable to get this list from the remote system due
to a network error, then Hot start processing will
not be performed. Note: This parameter overrides
the start parameter in the MFT Platform Server
template.
debugon Turns on DNI debugging. This parameter overrides
the debug parameter in the MFT Platform Server
template. This parameter should only be used
when instructed to do so by TIBCO Technical
Support.
debugoff Turns off DNI debugging. This parameter overrides
the debug parameter in the MFT Platform Server
template. This parameter should only be used
when instructed to do so by TIBCO Technical
Support.
version (-v) This option will display the dni version and PTF
level.

10.3.2 DNI Template Parameters

Each DNI template is divided into sections, DNI transfer


information, Post Processing Actions, and DNI Scan Schedule.

The DNI transfer information section defines the directory to be


scanned and what command is to be executed when a file is found
in that directory. The sample shown below is this section of the
dnitemplate.send template.

# Sample Platform Server for UNIX SEND template


# Define DNI transfer information:
# LocalDirectory Local Directory to scan for
files
# DNICommand Command to execute when file
is detected
# SubDirectory Defines if subdirectory
scanning is on (Yes) or off (No)
# FileFilter Limits files selected to
file names matching the Filter

TIBCO Perl Directory Named Initiation (DNI) User Guide


# DirectoryREGEX Limits directories selected
to directory names matching the REGEX
# FileREGEX Limits files selected to
file names matching the REGEX
# StartDate Limits files selected to
files with ModifyDate >= StartDate

# LeaveRetention Same as StartDate but this


defines the number of days retained and is
recomputed when the date changes
# Valid DNI Tokens for DNICommand, SuccessFile and
FailureFile
# $(YYYYMMDD) ==> Current Gregorian date in
format YYYYMMDD
# $(YYMMDD) ==> Current Gregorian date in
format YYMMDD
# $(YYYYDDD) ==> Current Julian date in
format YYYYDDD
# $(YYDDD) ==> Current Julian date in
format YYDDD
# $(YYYY) ==> Current Year in format
YYYY
# $(MM) ==> Current Month of Year in
format MM
# $(DD) ==> Current Day of Month in
format DD
# $(HHMMSS) ==> Current Time in format
HHMMSS
# $(HH24) ==> Current Hours in 24 hour
format HH
# $(MI) ==> Current Minutes in format
MM
# $(SS) ==> Current Minutes in format
SS
# $(LocalFile) ==> Local File name without
Path Name
# $(LocalFileBase) ==> Local File name without
Extension and Path Name
# $(LocalFileExt) ==> Local File name extension
(after last .)
# $(LocalFileName) ==> Local File name with Path
Name
# $(LocalFilePath) ==> Local File Path Name
# $(LocalHLQ) ==> Local File Name High Level
Qualifier

TIBCO Perl Directory Named Initiation (DNI) User Guide


# $(LocalNoHLQ) ==> Local File Name without
High Level Qualifier
# $(LocalFilePathLDir)==> Local File Path
leftmost directory name
# $(LocalFilePathRDir)==> Local File Path
rightmost directory name
# $(D01) ==> $(D16) ==> Directory names: left to
right, 1 to 16
# $(F01) ==> $(F16) ==> File names: left to
right, 1 to 16
# $(SubDir) ==> Subdirectory name without
leading /
LocalDirectory: /DNI/Files/
DNICommand: cfsend t:cftemplate
lf:$(LocalFileName) rf:/DNI/Target/$
(LocalFile) sm:y
SubDirectory: No
# Note that FileFilter and FileREGEX are mutually
exclusive
#FileFilter: tes*.txt
#FileREGEX: ^tes.*\.txt$
#DirectoryREGEX:
^.*(\\|\/)output(\\|\/|\Z).*$
#StartDate: 20150101
#LeaveRetention: 30

The sample templates include a list of supported DNI tokens for


the transfer type being configured.

TIBCO Perl Directory Named Initiation (DNI) User Guide


File Tokens

DNI File Tokens can be used for DNICommand, SuccessFile and


FailureFile parameter values.

DNI Tokens:

Token Name Description


$(YYYYMMDD) Current date in the format YYYYMMDD
(Gregorian date)
$(YYMMDD) Current date in the format YYMMDD
(Gregorian Date)
$(YYYYDDD) Current date in the format YYYYDDD (Julian
date)
$(YYDDD) Current date in the format YYDDD (Julian
date)
$(YYYY) Current Year
$(MM) Current Month
$(DD) Current Day within Month
$(HHMMSS) Current Time in format HHMMSS (24 hour
format)
$(HH24) Current Hour in 24 hour format
$(MI) Current Minutes within the current hour
$(SS) Current Seconds within the current minute
$(LocalFile) File name without the directory. DNI Send
only.
$(LocalFileName) Fully qualified file name (with directory).
DNI Send only.
$(LocalFileBase) File name without the extension (file name
before last period(.)). DNI Send only.
$(LocalFileExt) File name extension (file name after last
period(.)). DNI Send only.
$(LocalFilePath) Path name of the file. DNI Send only.
$(LocalHLQ) Local File Name High Level Qualifier

TIBCO Perl Directory Named Initiation (DNI) User Guide


Token Name Description
$(LocalNoHLQ) Local File Name without the High Level
Qualifier
$(LocalFilePathLDir) Local File path leftmost directory name
$(LocalFilePathRDir) Local File path rightmost directory name
$(RemoteFile) File name without the directory. DNI
Receive only.
$(RemoteFileName) Fully qualified file name (with directory).
DNI Receive only.
$(RemoteFileBase) File name without the extension (file name
before last period(.)). DNI Receive only.
$(RemoteFileExt) File name extension (file name after last
period(.)). DNI Receive only.
$(RemoteFilePath) Path name of the file. DNI Receive only.
$(RemoteHLQ) Remote File Name High Level Qualifier
$(RemoteNoHLQ) Remote File Name without the High Level
Qualifier
$(RemoteFilePathLDir) Remote File path leftmost directory name
$(RemoteFilePathRDir) Remote File path rightmost directory name
$(D01) - $(D16) Directory names: left to right, 1 to 16
$(F01) - $(F16) File names: left to right, 1 to 16
$(SubDir) Subdirectory of the file (directory name
after removing the LocalDirectory. This
template does not contain a leading slash (/
or \ depending on whether you are running
on UNIX or Windows). This token is unique
and can be used in a special way. Please
read the section Special SubDir Token Use.

Special SubDir Token Use


Note that there is a special use for the $(SubDir) token. Lets say
that you have 5 systems running MFT Platform Server, and that
you want to send files to each of the 5 systems. You could set up

TIBCO Perl Directory Named Initiation (DNI) User Guide


5 DNI executions, each of which has a template configured
especially for that system. A second option is to set up your
directory structure in such a way that the subdirectory name
matches the Node name for the remote systems.

As an example, lets say that you have 5 systems running MFT


Platform Server. They are called:
Red, Blue, Green, Black, White
You could set up your directory structure in the following manner:
Main directory Sub Directories
DNI Red
Blue
Green
Black
White
You could set up your DNI transfer fields, so that a single DNI task
could handle transfers to all 5 of the systems.
On a UNIX system you could have for example:
LocalDirectory: /DNI
DNICommand: cfsend t:templateName n:$(SubDir)
lf:$(LocalFileName) rf:/DNI/Target/$(LocalFile) sm:y
On a Windows system you could have for example:
LocalDirectory: c:\DNI\Source
DNICommand: ftmscmd /tcp /send /file /node:$(SubDir)
/rd:domainname $(LocalFileName)
c:\DNI\Target\$(LocalFile)

Note that DNICommand will override the Node parameter (n:)


with the name of the subdirectory. In this case, you must define
MFT Platform Server nodes for each of the subdirectories using
the cfnode program. In other words, you must execute the

TIBCO Perl Directory Named Initiation (DNI) User Guide


cfnode program 5 times to add node definitions for Red, Blue,
Green, Black and White systems.

When file AcctData is added to the Red directory, DNI will


detect the file, and execute the DNICommand. Before executing
the DNICommand, it will perform token substitution, and replace
the value $(SubDir) with the value Red. Therefore, the
DNICommand will be changed to the following:

On a UNIX system:

cfsend t:templateName n:Red


lf:/DNI/Red/AcctData rf:/DNI/Target/AcctData
sm:y

On a Windows System:

ftmscmd /tcp /send /file /node:Red


c:\DNI\Source\Red\AcctData
c:\DNI\Target\AcctData
Another use for the $(SubDir) token is to specify a subdirectory
name when performing Post Processing actions. If you want to
move files based on success or failure and you want to retain the
directory structure, you can use the $(SubDir) token.

TIBCO Perl Directory Named Initiation (DNI) User Guide


DNI Template Parameters

DNI Transfer Parameters for FTP:


Parameter Description
FTPHost FTP Host Name
FTPPort FTP Port number
FTPUser FTP Userid
FTPPassword FTP Password
FTPPasswordEncrypted FTP Password Encrypted
FTPRemoteDirectory FTP Server Directory
FTPLocalDirectory Local Directory to write files
FTPSlash Defines slash that FTP uses (/ or \)
FTPActivePassive Defines whether to use Active or Passive
FTP
FTPSubdirCount Defines the number of subdirectories to
scan
SubDirectory Defines if subdirectory scanning is on (Yes)
or off (No)
FileREGEX Limits files selected to file names matching
the REGEX
DirectoryREGEX Limits directories selected to directory
names matching the REGEX

DNI Transfer Parameters for Platform Server:


Parameter Description
LocalDirectory Used in the DNI Send template. Defines the
local directory that DNI will scan to see if there
are any files. DNI will read all normal files from
this directory. If the SubDirectory parameter is
defined as Yes, then DNI will also read normal
files from all subdirectories. DNI Tokens can be
used to customize this parameter.
RemoteDirectory Used in the DNI Receive template. It defines
the remote directory that DNI will scan to see
if there are any files. DNI will send a command

TIBCO Perl Directory Named Initiation (DNI) User Guide


Parameter Description
to the remote system to read all normal files in
this directory. If the sub directory parameter is
defined as Yes, then DNI will read all normal
files from all subdirectories.
DNICommand Defines the command that DNI will execute
when a file is detected. Note that the default
is to execute a CFSEND for DNI Send and cfrecv
for DNI Receive command. Note that the
default DNICommand defines in the template
has DNI tokens such as $(LocalFileName) and
$(LocalFile). These tokens are defined in the
section DNI Tokens. Note that this
command can be customized to add as many
parameters as needed. An alternate way is to
define all of the file transfer commands within
the template.
SubDirectory Defines whether subdirectories are scanned
for files. The default value of No indicates
that subdirectories will not be scanned for
files, while specifying Yes will cause DNI to
scan all subdirectories for files.
FileFilter Setting this parameter allows a user to limit
the files selected to be transferred.based on
the file name. FileFilter supports the wildcard
characters * and ?.
Note:
1) Filters run on UNIX platforms are case
sensitive
2) Filters run on Windows platforms are
case insensitive
3) DNI Receive filters are always case
insensitive
4) FileFilter is mutually exclusive with
FileREGEX

Example file filter: tes*.txt


FileREGEX Setting this parameter allows a user to limit
the files selected to be transferred based on
the file name. This parameter uses standard

TIBCO Perl Directory Named Initiation (DNI) User Guide


Parameter Description
REGEX patterns to filter files.
Note:
1) Filters run on UNIX patterns are case
sensitive
2) Filters run on Windows patterns are
case insensitive
3) DNI Receive patterns are always case
insensitive
4) FileREGEX is mutually exclusive with
FileFilters

Example file filter: ^tes.*\.txt$


DirectoryREGEX Setting this parameter allows the user to limit
the directories that will be scanned based on
the directory name.
For Example, say you had the following
directory structure:
/data/customer1/input
/data/customer1/output
/data/customer2/input
/data/customer2/output

You want to have a single DNI that processed


the /data directory but only wanted to process
the "output" sub directories. You would use
the DirectoryREGEX parameter so that only
the directories with the output were
included. Other directories would not be
scanned.

This parameter uses standard REGEX patterns


to filter directories.
Note:
1) Filters run on UNIX patterns are case
sensitive
2) Filters run on Windows patterns are
case insensitive
3) DNI Receive patterns are always case

TIBCO Perl Directory Named Initiation (DNI) User Guide


Parameter Description
insensitive
4) FileREGEX is mutually exclusive with
FileFilters

Example file filter:


^.*(\\|\/)output(\\|\/|\Z).*$
StartDate Defines the start date for files to be selected.
All files that have a Date Last Modified before
this date will not be transferred. Entries in the
leavefile with older Date Last Modified will be
removed. If this parameter is not defined, the
file date will not be checked when determining
the files that should be transferred or
removed from the leavefile. The format for
this field is: YYYYMMDD
LeaveRetention This parameter is similar to the "StartDate"
parameter except that it computes the
StartDate based on the number of days
defined in the LeaveRetention parameter.
Each day when the date changes the entries in
the leavefile with older dates will be removed.
Note: This parameter is ignored on FTP
Receive.

Transfer File Disposition:

Use the Transfer File Disposition section of the DNI template to


configure what happens after the DNI transfer. The example
shown here is from the dnitemplate.send.

# Transfer File Disposition:

TIBCO Perl Directory Named Initiation (DNI) User Guide


# SuccessAction Valid SuccessAction: leave,
move, delete
# SuccessFile Required if
SuccessAction:Move - Defines Target File Name for
move
# FailureAction Valid values: leave, move,
retry
# FailureFile Required if
FailureAction:Move - Defines Target File Name for
move
# NetworkErrorAction Valid values: leave, move,
retry
# NetworkErrorFile Required if
NetworkErrorAction:Move - Defines Target File Name
for move

Parameter Description
SuccessAction Defines what is done with the file when the
DNICommand is executed successfully.
Valid values: leave | move | delete
Note: It is best practice to define the DNI
disposition as move or delete, as this
reduces overhead associated with
managing the leave file and clearly
identifies which files are pending transfer
versus failed.
SuccessFile This parameter is only used when
SuccessAction is defined as move. It
defines the fully qualified name of the
target file for the move command
executed as a result of a successful
DNICommand execution. You can use DNI
tokens to customize the SuccessFile name.
DNI Tokens can be used to customize this
parameter.
FailureAction Defines what is done with the file when the
DNICommand fails. Valid values: leave |
move | retry
Note: It is best practice to define the DNI
disposition as move or delete, as this
reduces overhead associated with

TIBCO Perl Directory Named Initiation (DNI) User Guide


Parameter Description
managing the leave file and clearly
identifies which files are pending transfer
versus failed.
FailureFile This parameter is only used when
FailureAction is defined as move. It
defines the fully qualified name of the
target file for the move command
executed as a result of an unsuccessful
DNICommand execution. You can use DNI
templates to customize the FailureFile
name. DNI Tokens can be used to
customize this parameter.
NetworkErrorAction Defines what is done with the file when the
DNICommand fails due to a network error.
Valid values: leave | move | retry
Note: It is best practice to define the DNI
disposition as move or delete, as this
reduces overhead associated with
managing the leave file and clearly
identifies which files are pending transfer
versus failed.
NetworkFile This parameter is only used when
NetworkErrorAction is defined as move.
It defines the fully qualified name of the
target file for the move command
executed as a result of an unsuccessful
DNICommand execution. You can use DNI
templates to customize the NetworkFile
name.

Note: SuccessAction or FailureAction Leave will keep copies of


the directory entry for each file that has either transferred
successfully or has failed. If you transfer many different files (over
10,000) then the memory requirements of the in-storage copy of
the LeaveFile can get very high.

TIBCO Perl Directory Named Initiation (DNI) User Guide


DNI Scan Schedule:

The DNI Scan Schedule section allows you to define the times of
each day that DNI will scan the LocalDirectory (DNI Send) or
RemoteDirectory (DNI recv) for files. The days of the week must
be defined using the English spelling.

# DNI Scan Schedule:


# Each day can be defined with a Start and
Stop time in the format:
# HHMM:hhmm
# where HHMM is the start time from 0000 to
2359
# hhmm is the stop time from 0000 to
2359
# These times determine when DNI scans the
LocalDirectory for files.
# To turn off scanning for a day, specify
0000:0000
# You can define multiple lines for a single
day with different start and stop times.
# Note that the English spelling of these
names is required.

Sunday: 0000:2359
Monday: 0000:2359
Tuesday: 0000:2359
Wednesday: 0000:2359
Thursday: 0000:2359
Friday: 0000:2359
Saturday: 0000:2359

Miscellaneous Parameters:

The last section of the DNI template shows additional parameters


you can configure.

TIBCO Perl Directory Named Initiation (DNI) User Guide


# Miscellaneous parameters:
# ScanInterval Defines the number
of minutes between directory scans
# MaxConcurrent Defines number of
concurrent transfers (1 to 16)
# AutoEnable Defines whether this
template will be started at DNIDaemon
initialization
# LeaveFileName Defines Unique name
of file when SuccessAction:Leave
# PostActionFail Defines action when
a post action move or delete fails
# AuditDirectory Defines the
directory where pDNI Audit logs are written

# Start Defines Start action when


Action Leave is defined. Valid values are:
Warm (default), Cold, Hot
# Debug Defines whether DNI
debugging is on (Yes) or off (No)
ScanInterval: 5
MaxConcurrent: 1
# FileOrder: Uncomment one line to sort the
eligible transfer requests
# By default, no sorting is done on eligible
transfer requests
#FileOrder: AscendingDate
#FileOrder: DescendingDate
#FileOrder: AscendingSize
#FileOrder: DescendingSize
#FileOrder: AscendingFileName
#FileOrder: DescendingFileName
#FileOrder: AscendingDirNameFileName
#FileOrder: DescendingDirNameFileName
AutoEnable: No
LeaveFileName: ./leavefile.001
PostActionFail: Ignore
#AuditDirectory: ./Audit
Start: Warm
Debug: No

Parameter Description
ScanInterval Defines the number of minutes between
scans of the LocalDirectory. The default
value is 10 minutes. The processing of this

TIBCO Perl Directory Named Initiation (DNI) User Guide


Parameter Description
value depends on whether DNI Send or DNI
Receive is being executed:

DNI Send waits this interval between scans


of the directory. Additionally, DNI Send will
make sure that a file has not been updated
within this amount of time before it will
process the DNICommand for that file. If a
file has been changed in that interval, then
DNI will not process the file. Since the file
cannot be locked, this is how MFT Platform
Server can tell whether the file is in use or
not.

DNI Receive waits this interval between


scans. However, it does not perform the
same checking as DNI Send to see if a file
has been modified within an interval. It
will initiate a transfer as soon as it detects
that a file has been modified.

For testing, you may want to use the


minimum value of 1. For production,
unless the timeliness of the files is critical, a
higher value is usually appropriate.
MaxConcurrent Defines how many threads will be created
for DNI transfer requests. Valid values 1
16. Default value is 1.
FileOrder Use to sort the files in the order you want
the files to be transferred. Only one should
be set per template. By default no sorting is
done on the files to be transferred. Note:
This parameter is not supported for FTP
Receive.
AutoEnable This parameter controls if this dni template
will be started automatically when DNI
templates are being managed by MFT

TIBCO Perl Directory Named Initiation (DNI) User Guide


Parameter Description
Command Center.
LeaveFileName Defines the unique name of the leave file
where DNI saves information about the
DNICommand requests that have
completed successfully. This file is only
required when SuccessAction is defined as
leave. If you have multiple scripts
running with SuccessAction leave then
this file MUST be unique across all
executions of DNI. This file is used to save
the LeaveFile information across different
executions of DNI. If DNI comes down, or
the system is booted, then DNI will read
the information from the LeaveFile so that
the DNICommand is not executed multiple
times.
PostActionFail Creates a leave file to record file names if
the dispositions: SuccessAction,
FailureAction or NetworkErrorAction fail to
take place. This will allow files that have
been sent out successful to remote
locations not to be sent out multiple times.
Default value: Ignore. Valid values: Ignore,
Leave
AuditDirectory Enable this parameter when you need to
have an Audit file generated that will
contain details on each transaction that
takes place with the template.
Start Designed to give the Command Center
Administrators the ability to start the dni
template with a warm, cold or hot start.
Cold - The Cold option bypasses the
reading of the Leave file that contains the
list of files already transferred that is saved
when the SuccessAction and/or
FailureAction is set to leave. As defined
in the warm option description. As such,
DNI will transfer any file in the scan
directory when the script is started. This

TIBCO Perl Directory Named Initiation (DNI) User Guide


Parameter Description
option should be used with great care.
Warm - This parameter is only used when
a DNI SuccessAction or FailureAction is
defined as Leave. Due to this DNI will
keep track of files that have been
transferred and store the information in a
file. The warm option tells DNI to read the
Leave file and at start up and process the
files normally as if MFT Platform Server did
not come down. This makes sure that a file
is not transferred multiple times by
mistake. (This is the default when no
option is set.)
Hot - When defined, DNI will add all files
detected on the first directory scan to the
Leave file. Therefore the contents of the
directory when DNI is started will not be
transferred. Note that a Hot start creates
the Leave file with the contents of the
directory after the first scan. If DNI Receive
is unable to get this list from the remote
system due to a network error, then Hot
start processing will not be performed.
Debug Defines whether DNI debugging is turned
on. This parameter should only be set
when instructed to do so by TIBCO
Technical Support.
TempDirectory It is used only by DNI Receive. It defines the
name of a directory where DNI will save
temporary files. DNI must be able to create
and read files in this directory. This
parameter defaults to the current working
directory.
EncryptedPassword This parameter is seen when the perl dni
encrypt command has been run against the
dnitemplate in order to encrypt the remote
users password that is associated with the
dni template.

TIBCO Perl Directory Named Initiation (DNI) User Guide


TIBCO Perl Directory Named Initiation (DNI) User Guide
Encrypting a DNI Template Password

To perform a DNI transfer request to a remote platform a remote


user id and password is required. When the remote password is
used in the DNICommand field within a DNI template this
password is displayed in clear text. For some environments this
may not be acceptable. To encrypt the password being used for a
DNI template the perl dni encrypt command can be used. When
the password is encrypted the $(Password) token contained in
quotes must be configured for the remote password field. Below
is an example dni encrypt command:
perl dni encrypt t:dnitemplatename

This command will prompt the end used to enter the password to
be used for the dni template and to confirm that password. When
the command completes the EncryptedPassword parameter will
be added to the end of your DNI template containing the
encrypted password. The DNICommand being run would then be
changed to look like this on a UNIX system:

cfsend n:SystemA lf:"$(LocalFileName)"


rf:"/DNI/Target/$(LocalFile)" uid:remote_user
pwd:$(Password) sm:y

The DNICommand being run would then be changed to look like


this on a Windows system:

ftmscmd /tcp /send /file /node:SystemA


c:\DNI\Source\Red\AcctData
c:\DNI\Target\AcctData /ri:remote_user
/rw:$(Password) sm:y

Note: The $(Password) token is only available to be used within


the DNICommand field and not from a transfer template such as
TSEND.

TIBCO Perl Directory Named Initiation (DNI) User Guide


For more information on the dni encrypt command run the
following dni help command:

perl dni help encrypt

TIBCO Perl Directory Named Initiation (DNI) User Guide


Configuring DNI Management for Command Center

Using the MFT Command Center v7.2.0 or higher to manage all


DNI templates from a single location. In order to allow an MFT
Command Center to communicate with either a Platform Server
on a UNIX or Windows platform or Platform Server Agent you
must first set the DNI communication parameters contained in the
DNIConfig.cfg file.

Note: This functionality is not supported on HP-UX RISC systems.

Parameter Description
ListenPort Defines the IP Port that the DNI Daemon
will listen for incoming requests from MFT
Command Center. Preset to value 47777.
AdapterIPAddress Defines the IP Address of the Adapter that
the DNI Daemon will bind to. Preset to
value All. When All is used the IP address to
bind to is 0.0.0.0.
AcceptIPAddress Defines an IP address or DNS name that
points to an MFT Command Center. One
parameter per IP address or DNS name can
be defined. If you want to allow all
incoming requests regardless of the IP or
DNS name you can set this parameter to
All.
LogDirectory Defines the directory where the log files
from the DNI processes will be saved.
Debug Defines whether DNIDaemon.pl debugging
is turned on. This parameter should only
be set when instructed to do so by TIBCO
Technical Support. Preset to value No.
EncryptCmdPwd When this parameter is enabled and an MFT
Command Center user creates/updates a
template file, DNIDaemon will do the
following:
If the Template Parameter Name is
"DNICommand" or "RemoteCommand"
: If the sub-parameter is "/rw:" or
"/RemotePassword:" or "/rw=" or

TIBCO Perl Directory Named Initiation (DNI) User Guide


Parameter Description
"/RemotePassword=" or "pwd:" or "password:"
: Extract the password from the command line
parameter
: If the password is NOT "$(Password)"
: Encrypt the password using the existing
password encryption algorithm
: Replace the password with the $(Password)
token
: Add the "EncryptedPassword" parameter to
the last line of the dni template file (replace
existing EncryptedPassword file if necessary)

Once you have set the ListenPort, the AdapterIPAddress if needed,


and the AcceptIPAddress of an MFT Command Center you have to
define and encrypt a user id and password to be used by MFT
Command Center to authenticate with to the server. This can be
any user id and password you wish to use. Below is an example of
the command to run:

perl DNIDaemon.pl c:DNIConfig.cfg encrypt


When you run the command you will be prompted for the user id
and password. Be sure and note the user id and password that has
been set as the MFT Command Center Administrator will need this
information. If you have forgotten your user id and password you
can reset it by running the command again.
The command will add the Authenticate parameter to the
DNIConfig.cfg file with the information encrypted.
You are now ready to run the DNIDaemon perl script. This script
will listen for incoming requests from MFT Command Center. Use
the following command to run the script in the foreground:

perl DNIDaemon.pl c:DNIConfig.cfg


If you are working on a UNIX platform placing an ampersand (&) at
the end of the command will allow it to run in the background.
Below is an example:

perl DNIDaemon.pl c:DNIConfig.cfg &

TIBCO Perl Directory Named Initiation (DNI) User Guide


If you are working on a Windows platform you can use the start
command to run the program in a separate window while writing
the output from dni to a log file. Below is an example:

start /D"c:\dniDirectory\" cmd /C perl


DNIDaemon.pl c:DNIConfig.cfg ^>LogFileName 2>&1

TIBCO Perl Directory Named Initiation (DNI) User Guide

You might also like