Tivoli Directory Integrator, Version 7.1.1

Command line Connector

The command line Connector enables you to read the output from a command line or pipe data to a command line's standard input. Every command argument is separated by a space character, and quotes are ignored. The command is run on the local machine.

Note:
You do not get a separate shell, so redirection characters ( | > and so forth) do not work. To use redirection, make a shell-script (UNIX) or batch command (DOS) with a suitable set of parameters. For example, on a Windows system, type
cmd /c dir
to list the contents of a directory.

The Connector supports Iterator and AddOnly mode, as well as CallReply mode.

In Iterator and AddOnly mode, the command specified by the Command Line parameter is issued to the target system during Connector initialization, which implies it will only be issued once for the whole AssemblyLine lifetime.

However, in CallReply mode, the command is issued to the target system on each iteration of the AssemblyLine, after Output Attribute Mapping (call phase), and before Input Attribute Mapping (reply phase). In this mode, you must provide the command to be executed in an attribute called command.line; after it has executed you will find the output result in an attribute called command.output.

If a Parser is attached to the Command Line Connector, the output result will be parsed.

Native-encoded output on some operating systems

When you use the Command Line Connector to run a program on a Windows operating system, the output from the program might be encoded using a DOS code page. This can cause unexpected results, because Windows programs usually use a Windows code page. Because a DOS code page is different from a Windows code page, it might be necessary to set the Character Encoding in the Command Line Connector's Parser to the correct DOS code page for your region; for example: cp850.

The same issue may arise on for example i5/OS®; here the output from commands is usually encoded in the IBM037 character set; and on z/OS® it could be EBCDIC.

Also see Character Encoding conversion.

Some words on quoting

On Linux/Unix systems, this Connector has the capability to attempt to deal with the quoting of parameters that may contain lexically important characters. When the parameter Use sh is checked, Tivoli® Directory Integrator uses the sh program (for example, the standard Linux shell) to run the command line, and sh will handle quoting as you expect. If you do not have sh on your operating system, do not check this box.

Without using sh, when the Command Line Connector is run on a Unix/Linux platform, it does not handle a command line with a parameter in quotes correctly. For example, the command:

Report -view fileView -raw -where "releaseName = 'ibmdi_60' and nuPathName like 'src/com/ibm/di%' " 

This command should have the phrase "releaseName = 'ibmdi_60' and nuPathName like 'src/com/ibm/di%' " as one parameter, but it does not. The reason is that Tivoli Directory Integrator uses the Java Runtime exec() method, which splits all commands at spaces, and ignores all quoting. We would have liked this to be split according to the quotes. Checking Use sh (when possible) solves this problem.

Configuration

The Connector needs the following parameters:

Command Line
The command line to run. Used for Iterator and AddOnly modes only.
Use sh
If enabled (by default it is not), will instruct the Connector to use sh-like parsing. Specifically, when this parameter is set to true the Connector is able to correctly parse quoted (using double-quotation marks) command line arguments which contain spaces.

This feature is only available on operating systems which provide the "sh" shell command interpreter (usually UNIX-like operating systems).

Detailed Log
If this field is checked, additional log messages are generated.
Parser
The Parser responsible for interpreting or generating entries.

Examples

Refer to the TDI_install_dir/examples/commandLine_connector directory of your IBM® Tivoli Directory Integrator installation.

See also

Remote Command Line Function Component,
z/OS TSO/E Command Line Function Component
[ Top of Page | Previous Page | Next Page | Contents | Terms of use | Feedback ]
(C) Copyright IBM Corporation, 2003, 2012. All Rights Reserved.
IBM Tivoli Directory Integrator 7.1.1