Command Line adapter module


The Command Line process invokes the command line program on a peer. The following table describes the process inputs for the Command Line process.

Input

Description

Required

<adapter name>

Specifies the name of the adapter to use for this process

Default value: CommandLineAdapter

No

<command>

Specifies an XML document that contains the commands in the request

The wrapper process does not check the XML syntax.

Default value: echo Success

No

<commands>

Specifies the string that specifies the commands and any arguments for the request

You might need to provide parameters other than the command type when using the wrapper parameters like target or prompts.

  • If you provide only the <command> parameter, a workflow generates from the other command inputs and executes:
    <command prompt="promplt1"ignore-exit-code="true">cmd1</command>
  • If you provide only the <commands> parameter, the workflow uses the provided commands in the following format:
    <commands>
     <command prompt="promplt1"ignore-exit-code="true">cmd1</command>
     <command>cmd2</command>
     <command>cmd3</command>
     </commands>
  • If you provide both, command and commands, the workflow executes the command provided by the user.

No

<mask-command-string>

Specifies whether to mask the command strings in the adapter response.

If true, data in the <command> element in the response XML is masked.

Valid values: true, false (default)

No

<working directory>

Specifies the directory in which to execute the command

Default value: current directory

No

<command directory>

Specifies the directory where the command is located

Default value: current directory

No

<command encryption type>

Specifies the method of encryption used for the command value provided

Valid value: Base64, Plain (default)

No

<command timeout>

Specifies the time, in seconds, allotted to complete the execution of the command

Default value: 60 seconds

No

<environment variables>

Specifies an XML document that contains the environment variables to set or clear before executing a command

No

<run-as>

Specifies a boolean value to execute the command as a different user

This attribute must be set to true to execute the command as a different user.

Valid values: true, false (default)

No

<user-name>

Specifies the name of an existing user using which the command is executed

Conditional; required if the run-as attribute is set to true

<password>

Specifies the password for the user account specified in user-name

Conditional; required if the run-as attribute is set to true

<wait-for-command-output>

Specifies whether to wait for the process or command output or until the adapter times-out; is an attribute of the <command> element, not an element itself

When this value is set to true, the adapter waits for the process output or the adapter time-out duration. When you set this value to false, the adapter returns the execution status of the command.

Valid values: true, false (default)

Note:

  • BMC recommends that you do not set this attribute to execute programs (.exe ) for which no output is expected. For example, notepad.exe.
  • wait-for-command-output attribute is supported on Microsoft Windows only.

No

<krb-authentication>

Specifies a boolean value to execute the command as a different user using Kerberos authentication

This attribute must be set to true to execute the command as a different user using a Kerberos ticket to authenticate the user.

Valid values: true, false (default)

No

<krb-command>

Specifies the command used by the adapter to support run-as with Kerberos authentication

Use this attribute to switch to a different command similar to ksu (for example, kuu ). krb-command is supported for run-as on Linux and UNIX only.

Default value: ksu

No

<krb-options>

Specifies the krb-options for the krb-command

Valid values:
 -n principal_name: Specifies a Kerberos principal name for a specified krb user
 -c cache_name: Specifies a cache name (for example, FILE:/tmp/my_cache )
 -k: Specifies that the target cache must not be deleted upon termination of the target shell or a command
If you do not specify the -k option, the adapter deletes the target cache.

Note: The above command options are specific to ksu. You can set krb-options specific to the krb-command that you specify. krb-options is supported for run-as on Linux and UNIX only.

No

<continue-on-failure>

Specifies whether to execute a subsequent command when a command fails; is an attribute of the <command> element, not an element itself

Valid values: true, false

In the absence of this attribute, or if this attribute is set to false, if a command fails to execute, the adapter response is an error message and subsequent commands are not executed.

No

<ignore-exit-code>

Specifies whether to ignore an exit that the response returned; is an attribute of the <command> element, not an element itself

Valid values: true, false

No

<disable-line-termination>

Specifies menu commands that need to be sent as a single character without any line termination; is an attribute of the <command> element, not an element itself

With this attribute set to true, the command is sent without any termination character. In the absence of this attribute, or with this attribute set to false, the specified or default ( \n ) line termination character is sent with the command.

No

<is-special-character>

Defines a command for Escape (ESC), Line Feed (LF), or Carriage Return (CR) when set to true; is an attribute of the <command> element, not an element itself.

Valid values: true, false

In the absence of this attribute or if you set it to false, you can specify any valid OS command.

No


The following table describes the process output parameter for the Command Line process.

Process output

Description

adapter response

Specifies the Command Line adapter's response


 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

TrueSight Orchestration Content 23.1