Start Telnet Connection
Initiates a connection using the Telnet protocol to a remote server, according to previously defined settings such as: server, user, password and port.
Command availability: IBM RPA SaaS and IBM RPA on premises
Script syntax
IBM RPA's proprietary script language has a syntax similar to other programming languages. The script syntax defines the command's syntax in the script file. You can work with this syntax in IBM RPA Studio's Script mode.
startTelnet --host(String) --username(String) [--password(String)] [--port(Numeric)] [--timeout(TimeSpan)] (TelnetSession)=value
Input parameters
The following table displays the list of input parameters available in this command. In the table, you can see the parameter name when working in IBM RPA Studio's Script mode and its Designer mode equivalent label.
Designer mode label | Script mode name | Required | Accepted variable types | Description |
---|---|---|---|---|
Server | host |
Required |
Text |
Host address of the Telnet server. |
User Name | username |
Required |
Text |
Username for accessing the server. |
Password | password |
Optional |
Text |
Password to access the server. |
Port | port |
Optional |
Number |
Port number connecting to the host address of the Telnet server. If no information is entered, the standard port "23" is used. |
Timeout | timeout |
Optional |
Time Span, Number, Text |
Waiting time for the command to execute. If no value is defined in the parameter of type timeout, the execution uses the time defined by the Set Timeout command. If the script does not use this command, the default time is 5 seconds. |
Output parameters
Designer mode label | Script mode name | Accepted variable types | Description |
---|---|---|---|
Telnet Connection | value |
Telnet Session |
Returns the connection established with the Telnet server. |
Example
The example initiates a Telnet connection. Then, the Command parameter is defined as "status" within the request, using the Run Telnet Command command. Finally, the Terminate Telnet Connection command closes the connection.
defVar --name telnetConnection --type TelnetSession
defVar --name text --type String
// Connection to Telnet server established.
startTelnet --host "125.64.124.77" --username "User Name" --password Password --port 23 --timeout 00:00:05 telnetConnection=value
executeTelnet --client ${telnetConnection} --command status --timeout 00:00:12 text=value
closeTelnet --client ${telnetConnection}
// The example above demonstrates the connection to a specified Telnet server to send commands. All host, port and connection data are for example only, requiring the client services and Telnet server to be installed.