X4 Produktdokumentation

Telnet Connector

This adapter connects to servers via the Teletype Network Protocol

Properties

Operation

Operation performed by the adapter

Possible values: Execute: Executes the commands available via an input XML

Parameters

host

Required parameter: Host of the server to which the connection is to be established

Possible values:

  • IP: Any valid host IP, e.g. 1.1.1.1

  • String: Any valid host name, e.g. myServer.com

port

Port of the server to which the connection is to be established

Possible values:

  • Any integer

  • 23 (default): Default port for Telnet connections

user

User name for the Telnet connection

Possible values: String with the user name, e.g. MyUser

password

Password for the Telnet connection

Possible values: String with the Password, e.g. MyPassword

timeout

Connection timeout in milliseconds

Possible values:

  • Any integer

  • 30000 (default): Default value of 30 seconds

responseDelay

Response delay in milliseconds

Possible values:

  • Any integer

  • 750 (default): Default value of 0.75 seconds

cleanAnsiVTSequences

Specify whether the output should contain ANSI VT characters or not

Possible values:

  • true (default): The output contains ANSI VT characters

  • false: The output does not contain ANSI VT characters

Status values

1

The adapter operation was successfully executed

-1

An error occurred during the execution of the adapterThe adapter operation was executed successfully

Input

When connecting via Telnet, the adapter uses labels within the login: and password: credentials by default. However, if you want to connect to a machine that has different access labels, these can be configured in the input XML via the <Configuration> node.

The Telnet Connector expects the following input structure:

Input
XML
<Telnet> <!-- Any root name respecting XML naming rules -->
	<!-- Optional attributes. If ignored, the default patterns will be used. -->
	<Configuration loginLabel="Username: " passwordLabel="Password: "/> 
	<Commands>
		<Command value="ls -ll" />
		<Command value="mkdir /home/luis/myNewFolder"/>
		<Command value="touch /home/luis/myNewFolder/aNewEmptyFile.txt"/>
		<Command value="ls -ll"/>
	</Commands>
	<!-- Any number of Command nodes, which will be executed in the same connection -->
</Telnet>

Explanation:

  • Telnet: Root node

  • Configuration: Node with the same content as specified in the input. Although the node is required, the loginLabel and passwordLabel attributes are optional.

  • Commands: node that includes all commands used

  • Command: Any number of command nodes with a value attribute containing the commands to be executed.

Output

The Telnet Connector outputs an XML structure similar to the following output:

Output
XML
<Telnet>
	<LoginResult>Successful</LoginResult>
	<Configuration loginLabel="Username: " passwordLabel="Password: "/>
	<Commands>
		<Command value="ls -ll">total 52
			-rw-rw-r-- 1 ivan ivan 555 feb 24 15:30 a.txt
			drwxr-xr-x 2 ivan ivan 4096 feb 20 12:59 Desktop
			drwxr-xr-x 2 ivan ivan 4096 feb 20 12:59 Documents
			drwxr-xr-x 2 ivan ivan 4096 feb 20 12:59 Downloads
			-rw-r--r-- 1 ivan ivan 8980 feb 20 12:45 examples.desktop
			drwxrwxr-x 2 ivan ivan 4096 feb 21 14:54 mio
			drwxr-xr-x 2 ivan ivan 4096 feb 20 12:59 Music
			drwxr-xr-x 2 ivan ivan 4096 feb 20 12:59 Pictures
			drwxr-xr-x 2 ivan ivan 4096 feb 20 12:59 Public
			drwxr-xr-x 2 ivan ivan 4096 feb 20 12:59 Templates
			drwxr-xr-x 2 ivan ivan 4096 feb 20 12:59 Videos
			$
		</Command>
	</Commands>
	<!-- Command node containing the value (response) for each Command node available in the input file -->
</Telnet>

Explanation:

  • Telnet: Root node

  • LoginResult: Information about the login result. The value of the node is either Failed or Successful.

  • Configuration: Node with the same content as specified in the input.

  • Commands: node that includes all commands used

  • Command: Any number of command nodes with a value attribute containing the commands to be executed. The content of this node is the result of the command issued by the Telnet server.