Terminal - Connect
Declaration
<AMTERMINAL TYPE="text (options)" HOST="text" SESSION="text" PORT="number" SHOWTERMINALWINDOW="YES/NO" TERMINALCLOSE="YES/NO" EMULATION="text (options)" TERMINALTYPE="text (options)" FONTSIZE="number" TRYSIGNOFF="YES/NO" SSL="YES/NO" SSLVERSION="text (options)" ROOTCACERTIFICATEFILE="text" CLIENTCERTIFICATEFILE="text" KEYCERTIFICATEFILE="text" CRTIFICATEPASSWORD="text (encrypted)" PROMPT="text" PROMPTISRE="YES/NO" WAITFORPROMPT="YES/NO" PROMPTTIMEOUT="number" MEASURE="text (options)" LOGFILE="text" ENCRYPTIONALGORITHMS="text (options)" AUTHENTICATIONMETHOD="text (options)" PRIVATEKEY="text" PASSPHRASE="text (encrypted)" OVERWRITELOG="YES/NO" />
Description
Connects to a terminal using the specified emulation type and establishes a new terminal session which can be used in subsequent terminal related steps.
Practical usage
Used to begin a transaction with a terminal. This activity is used in conjunction with other terminal activities such as Terminal - Get text, Terminal - Control, or Terminal - Send text. These activities are used in lieu of terminal emulation software. By using Automate Desktop's terminal activities, legacy systems can be automated in the background without the use of 3rd party software.
Parameters
General
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Connection type | Text (options) | No | TCP/IP |
|
The
type of terminal connection to perform. If unsure which to use,
check with the administrator of the terminal. The available options
are:
|
Hostname | Text | Yes | (Empty) | HOST="ftp.netauto.com" | The IP address (for example, xxx.xxx.xxx.xxx) or a server/domain name (for example, server.domain.com) of the host server to connect to. |
Port | Number | No | 23 | PORT="25" | The
port to for TCP/IP, SSH, or SSL/TLS connections.
The default port numbers for each connection type are as follows:
|
Username | Text | No | (Empty) | USERNAME="Anonymous" | The username to use to authenticate and log in to an SSH server. The username should be pre-configured at the server level. This parameter is becomes available only if the Connection type parameter is set to SSH. |
Password | Text | No | (Empty) | PASSWORD="encrypted" | The password that corresponds with the Username parameter. This parameter becomes available if the Connection type parameter is set to SSH. |
Session | Text | No | TerminalSession1 | 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 TerminalSession1. |
Show terminal window | Yes/No | No | No | SHOWTERMINALWINDOW="YES" | If selected, 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 the developer can see what is occurring in the session. It is normally disabled during production so that the transaction occurs in the background and does not interfere with other tasks. This parameter is disabled by default. |
Close after completion | Yes/No | No | Yes | TERMINALCLOSE="NO" | If selected, the terminal window automatically closes after task execution. If disabled, the window remains open after task execution to allow manual work to be performed in the window, if desired. This parameter is selected by default. |
Advanced
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Emulation | No | No | ANSI |
|
The
type of terminal emulator that should be used. If you are unsure
of the value to use in this parameter, contact your server administrator.
The available options are:
|
Resource Name | Text | No | (Empty) | RESOURCENAME="resources>" | The resource name is a generic term for any of the following names: LU name, device name or device pool name. You may specify a Windows environment variable as the resource name. For example, if you specify %username%, it will be replaced by the Windows username when it is sent to the host. You may also specify a semicolon delimited list of resource names (for example, DEC-VT220;VT220;DEC-VT100;VT100). If the first resource is in use, then the session attempts to use the second, and so on. This parameter is available only when the Emulation parameter is set to TN3270 or TN5250. |
Terminal type | Text (options) | Yes, if Emulation is set to TN3270 or TN5250 |
|
|
Specifies the terminal window resolution to use with emulation type TN3270 or TN5250. This parameter is available
only when the Emulation parameter is set to TN3270 or TN5250.
The available options for TN3270 are:
The available options for TN5250 are:
For more information on these terminal types, see https://www.ibm.com/docs/en/i/7.4?topic=problems-troubleshooting-emulation-types. |
Try sign off at disconnect | Yes/No | No | Yes | TRYSIGNOFF="YES" | If selected (default), Automate Desktop navigates to the main IBM screen at runtime and sends a SIGNOFF command to attempt to end the job. This parameter is only available when the Emulation parameter is set to TN3270 or TN5250. |
Font size | Number | No | (Empty) | FONTSIZE="10" | Sets the font size of the terminal text for emulation types TN3270 and TN5250. The font size can range from 1-1000 (for example, 10). If no value is entered, a default size is used, based on the emulation type. This parameter is only available when the Emulation parameter is set to TN3270 or TN5250. |
SSL | Yes/No | No | No | SSL="YES" | If selected, this parameter allows the Terminal action to be configured to use a SSL/TLS connection. The default port number for SSL/TLS is 992. This parameter is only available when the Emulation parameter is set to TN3270 or TN5250 and is disabled by default. |
SSL/TLS version | Text (options) | Yes, if Emulation is set to TN3270 or TN5250 | TLS1.x |
|
Specifies the SSL/TLS version to use with the connection. This parameter is only available
when the SSL parameter is selected. The available options are:
|
Root CA Certificate File | Text | No | (Empty) | ROOTCACERTIFICATEFILE="rootcacertificate.txt" | The Root CA Certificate file to use with the SSL/TLS connection. This parameter is only available when the SSL parameter is selected. |
Client Certificate File | Text | No | (Empty) | CLIENTCERTIFICATEFILE="clientcertificate.txt" | The Client Certificate file to use with the SSL/TLS connection. This parameter is only available when the SSL parameter is selected. |
Key File | Text | No | (Empty) | KEYCERTIFICATEFILE="keycertificatefile.txt" | The Key Certificate file to use with the SSL/TLS connection. This parameter is only available when the SSL parameter is selected. |
Certificate Password | Text | No | (Empty) | CRTIFICATEPASSWORD="text (encrypted)" | The Certificate Password to use with the SSL/TLS connection. This parameter is only available when the SSL parameter is selected. |
Default prompt | Text | No | (Empty) | PROMPT="READY>" | The prompt that appears in the target terminal system. This allows subsequent terminal activities to wait until a certain prompt appears before executing. For example, on some terminal systems, the prompt is the text READY>. By specifying this value, Automate Desktop will know to wait until that text appears before moving onto the next step. |
Regular expression | Yes/No | No | No | PROMPTISRE="YES" | If selected, indicates that the text specified in the Default prompt parameter is a regular expression and not literal text. Specifying a regular expression can be useful This is useful in cases where the prompt may not always be the same but some portion of it is. This parameter is disabled by default. |
Wait for default Prompt | Yes/No | No | No | WAITFORPROMPT="YES" | If selected, 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 this parameter is disabled (default), the step will wait indefinitely. |
Time to wait (unlabeled) | Number | No | 10000 | PROMPTTIMEOUT="233" | The length of time allowed to wait for the default prompt before a time out error is thrown. This parameter corresponds with the time measurement specified in the Measure parameter below. |
Measure (unlabeled) | Text (options) | No | milliseconds |
|
The
time measurement that corresponds with the value entered in the
Time to wait parameter.
The available options are:
|
Key-Exchange algorithm(s) | Text (Options) | Yes | Any |
|
The key exchange algorithm to use during a SSH session. The available options are:
NOTE: This parameter is not available if the Emulation parameter is set to TN3270 or TN5250. |
Authentication Method | Text (Options) | Yes | Any |
|
The authentication method to use during a SSH session. The available options are:
NOTE: This parameter is not available if the Emulation parameter is set to TN3270 or TN5250. |
Private key file | Text | No | Empty | PRIVATE_KEY="C:\Temp\Private_Key_Location" | Specifies the path and file name of the private key file. This parameter only becomes available if the Authentication Method parameter is set to PublicKey. |
Passphrase | Text | No | Empty | PASSPHRASE="passphrase" | Specifies the pass phrase used to authenticate connection. A pass phrase is a password that comprises a whole phrase. This parameter only becomes available if the Authentication Method parameter is set to PublicKey. |
Log file | Text (options) | No | (Empty) |
LOGFILE="c:\temp\log.log" |
The path and file name of a log file in which to log data about the terminal connection. This log file can be useful in diagnosing particular errors or elusive connection problems. |
Overwrite existing log file | Yes/No | No | No |
OVERWRITELOG="NO" |
If selected, specifies that the log file should be overwritten with new log data if the same file already exists. If disabled (default), the file will not be overwritten, however, an error will occur at runtime as a result. The default value is YES. |
Examples
- Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
- To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.
Example 1
This sample task connects to a terminal.
<AMTERMINAL HOST="linux.networkautomation.com" SESSION="TerminalSession1" SHOWTERMINALWINDOW="YES" EMULATION="tn3270" RESOURCENAME="a" PROMPT="as" PROMPTISRE="YES" WAITFORPROMPT="YES" PROMPTTIMEOUT="233" MEASURE="seconds" />
Example 2
This sample task uses an assortment of terminal activities to automate a terminal logon process. Examining the step parameters and properties of this task may assist you in creating your own terminal emulation task.
<AMVARIABLE NAME="theUsername" VALUE="Username" />
<AMVARIABLE NAME="thePassword" VALUE="password"></AMVARIABLE>
<AMTERMINAL HOST="linux.networkautomation.com" SESSION="TerminalSession1" SHOWTERMINALWINDOW="YES" EMULATION="vt220" ENCRYPTIONALGORITHMS="Any" AUTHENTICATIONMETHOD="Any" />
<AMTERMINAL ACTIVITY="waitfor" SESSION="TerminalSession1" TEXT="login" />
<AMTERMINAL ACTIVITY="sendtext" SESSION="TerminalSession1" TEXT="%theUsername% {ENTER}" />
<AMSHOWDIALOG MESSAGE="OK to proceed?"></AMSHOWDIALOG>
<AMTERMINAL ACTIVITY="waitfor" SESSION="TerminalSession1" TEXT="Password" />
<AMTERMINAL ACTIVITY="sendtext" SESSION="TerminalSession1" TEXT="%thePassword% {ENTER}" />
<AMSHOWDIALOG MESSAGE="OK to proceed?"></AMSHOWDIALOG>
<AMTERMINAL ACTIVITY="disconnect" SESSION="TerminalSession1" />