Terminal - Disconnect

Declaration

<AMDISCONNECTTERM SESSION="text" />

Related Topics    

Description

Disconnects a terminal connection and ends a session previously established with the Connect Terminal activity.

Practical Usage

Used to disconnect from a transaction with a terminal. This step is always used in conjunction with other terminal actions such as Connect Terminal and Send Terminal Text. The terminal actions are used in leu of terminal emulation software. Using the terminal actions, legacy systems can be automated in the background without the use of 3rd party software.

Parameters

General

Property

Type

Required

Default

Markup

Description

Session Name

Text (options)

No

TermSess1

SESSION="terminalsession2"

The name of the session to disconnect. This session must have been created in a prior step using Connect Terminal. Session names allow several connections to be active simultaneously. If you are only using one connection at a time, do not specify a value other than the default.

Description

Error Causes

On Error

Examples

NOTE:
  • The sample AML code below can be copied and pasted directly into the Steps Panel of the Task Builder.
  • Parameters containing user credentials, files, file paths, and/or other information specific to the task must be customized before the sample code can run successfully.

Example 1

Disconnect terminal session named myTerminalSession.  

Copy
<AMTERMINAL ACTIVITY="disconnect" SESSION="myTerminalSession" />

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.

Copy
<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" />