Connect Terminal

Connects to a terminal using the specified emulation type and establishes a new terminal session name which can be used in subsequent Terminal actions. Used to begin a transaction with a terminal. This action is used in conjunction with the other terminal actions such as Get Terminal Text, Control Terminal or Send Terminal Text actions. These actions are used in leu of terminal emulation software. Using AWE's terminal actions, legacy systems can be automated in the background without the use of 3rd party software.

Declaration

<AMCONNECTTERM TYPE="text (options)" SESSION="text" PROMPT="text" EMULATION="text (options)" BAUDRATE="number" PARITY="text (options)" STOPBITS="number" DATABITS="number" FLOWCONTROL="text (options)" SHOWTERMINALWINDOW="YES/NO" WAITFORPROMPT="YES/NO" PROMPTTIMEOUT="number" MEASURE="text (options)" PROMPTISRE="YES/NO" />

Example 1 - Connect to terminal at linux.networkautomation.com port 23. The session name will be TermSess1. Wait 233 seconds for default prompt.

<AMCONNECTTERM RESOURCENAME="a" PROMPT="as" EMULATION="TN3270" HOST="linux.networkautomation.com" SHOWTERMINALWINDOW="YES" WAITFORPROMPT="YES" PROMPTTIMEOUT="233" MEASURE="seconds" PROMPTISRE="YES" />

Example 2 - A example that uses all available terminal actions. Examining the step parameters and properties of this task may assist you in creating your own terminal emulation task.

<AMVARIABLE NAME="thePassword">password</AMVARIABLE>

<AMCONNECTTERM EMULATION="VT220" HOST="linux.networkautomation.com" SHOWTERMINALWINDOW="YES" />

<AMWAITFORTERMTEXT TYPE="TEXT">login:</AMWAITFORTERMTEXT>

<AMSENDTERMTEXT>%theUsername%{ENTER}</AMSENDTERMTEXT>

<AMSHOWDIALOG>OK to proceed?</AMSHOWDIALOG>

<AMWAITFORTERMTEXT TYPE="TEXT">Password:</AMWAITFORTERMTEXT>

<AMSENDTERMTEXT>%thePassword%{ENTER}</AMSENDTERMTEXT>

<AMSHOWDIALOG>OK to proceed?</AMSHOWDIALOG>

<AMDISCONNECTTERM />

See Also: Disconnect Terminal, Send Terminal Text, Get Terminal Text, Wait Terminal, Control Terminal

General Tab

Property

Type

Required

Default

Markup

Description

Connection type

Text (options)

No

TCP/IP

TYPE="SSH"

The type of terminal connection to perform. If unsure which to use, check with the administrator of the terminal. The available options are:

  • TCP/IP: Connection is established using TCP/IP.

  • SSH: Connection is established using a secure socket.

  • COM1: Connection is established through the serial COM1 port.

  • COM2: Connection is established through the serial COM2 port.

Hostname

Text

Yes

(Empty)

HOST="ftp.netauto.com"

The IP address (i.e. xxx.xxx.xxx.xxx) or a server / domain name (i.e. server.domain.com) of the host server to connect to.

Username

Text

Yes

(Empty)

USERNAME="Anonymous"

The username that should be used when logging onto an SSH server. The Username should be pre-configured at the server level. This parameter is valid only if the Connection Type parameter is set to SSH.

Password

Text

Yes

(Empty)

PASSWORD="myPassword"

The password that corresponds to the username that is to be used when logging onto the an SSH server. This parameter is valid only if the Connection Type parameter is set to SSH.

Baud rate

Number (options)

No

9600

BAUDRATE="921600"

The speed of transmission between the local computer and terminal. The available values range from 110 to 921600. The default value is set to 9600.

Data bits

Number (options)

No

8

DATABITS="5"

The number of bits containing data in a transmission (because 8 bits make up a character, data bits are often referred to as character bits). The available values are 5 (default), 6, 7, and 8 bits.

Stop bits

Number (options)

No

1

STOPBITS="1.5"

The number of bits that signals the end of a character. The available values are 1, 1.5 or 2 bits.

Parity

Text (options)

No

None

PARITY="Odd"

Whether the parity bit is set to even or odd. Parity bits are used as the simplest form of error detecting code. The available options are:

  • None (default)

  • Even

  • Odd

Flow control

Text (options)

No

None

FLOWCONTROL="Hardware"

Flow control is the process of managing the rate of data transmission between two nodes to prevent a fast sender from outrunning a slow receiver. The available options are:

  • None (default)

  • Hardware

  • Software

Port

Number

No

23

PORT="25"

The port that should be used to connect to the TCP/IP or SSH server. This usually takes place on port 23 for TCP/IP and port 22 for SSH, however it is possible to customize this setting on the server.

Session name

Text

No

TermSess1

SESSION="mySession"

The session name to identify this terminal connection request in subsequent terminal steps. This allows several terminal sessions to be active simultaneously.

NOTE: If you are only using one connection at a time, you do not need to specify a value other than the default, which is TermSess1.

Show terminal window

Yes/No

No

No

SHOWTERMINALWINDOW="YES"

If set to YES, a window will be displayed at runtime showing the results of the terminal transaction. This option is normally enabled while debugging the task so that you can see what is occurring in the session. It is normally disabled during production use so that the transaction occurs in the background and does not interfere with other tasks. This parameter is set to NO by default.

Attributes Tab

Property

Type

Required

Default

Markup

Description

Emulation

No

No

ANSI

EMULATION="TTY"

The emulation type that should be used. If you are unsure of the value to use in this parameter, contact the server administrator or developer of the system. The available options are:

  • TTY: Use the TTY terminal emulation standard

  • ANSI (default): Use the ANSI terminal emulation standard

  • VT52: Use the VT52 terminal emulation standard

  • VT100: Use the VT100 terminal emulation standard

  • VT220: Use the VT220 terminal emulation standard

  • VT320: Use the VT320 terminal emulation standard

  • TN3270: Use the TN3270 terminal emulation standard

  • TN5250: Use the TN5250 terminal emulation standard

Resource Name

Text

No

(Empty)

RESOURCENAME="Text>"

A resource name (LU name, device name or device pool name) for a session. This parameter is available only when TN3270 or TN5250 is selected from the Emulation Type parameter.

Default prompt

Text

No

(Empty)

PROMPT="READY>"

The prompt that is utilized on the target terminal system. This allows the terminal actions to wait until a certain prompt appears before moving on to the next step. For example, on some terminal systems, the prompt is the text "READY>". By specifying this value, AWE will know to wait until that text appears before moving on.

Regular expression

Yes/No

No

No

PROMPTISRE="YES"

If set to YES, indicates that the text specified in Default Prompt parameter is a regular expression and not literal text. This is useful in cases where the prompt may not always be the same but some portion of it is. This parameter is set to NO by default.

Wait for default Prompt

Yes/No

No

No

WAITFORPROMPT="YES"

If set to YES, indicates that the step will wait the for the default prompt to appear until the specified amount of time. If the default prompt does not appear within the amount of time specified, execution halts with a time-out error. If set to NO (default), the step will wait indefinitely.

Time to wait

Number

No

10000

PROMPTTIMEOUT="233"

The wait value. This parameter corresponds with the measure selected (i.e. milliseconds, seconds)

Measure

Text (options)

No

milliseconds

MEASURE="seconds"

The time measurement that corresponds with the value entered in the Time to wait parameter. The available options are:

  • Milliseconds (Default)

  • Seconds

  • Minutes

  • Hours