Hardware Management Console Installation and Operations Guide


Appendix B. Using Scripts to Connect Remotely

You can open a virtual terminal to a partition remotely for maintenance purposes. This appendix describes how to connect to your HMC remotely.

The following script demonstrates one method for connecting to the HMC remotely, by using telnet. To connect to the virtual terminal without using the HMC Terminal Emulator, you must first build a connection string. The following is an example of an ASCII string that is sent to the HMC terminal server to establish a connection:

0: FFFX
Start of string indicator:

FFFX - connect and issue terminal open command

FFFF - connect but assume terminal is already open

1: 31
Count in integer ASCII. The number of characters that follow the * character, which follow the start of the string indicator. In the above example, count from e in ehsc2 to the end of the string.

2: ehsc2
Host name or IP address of the HMC workstation.

3: 9734
Port number of control element. In this example, 9734 is the port number.

4: 4
Partition slot number. 0 is used to open a terminal on the managed system in both Partition Standby and Full System Partition modes. You can access the service processor menus from partition 0.

Slots 1 to 16 are valid in Partition Standby mode only.

View the partition's properties to determine the partition slot number for a partition.

5: 7040-680
Machine type and model of the managed system. Use the managed system's properties panel to get the machine type and model. Do not use the user-assigned managed system name.

6: 382963
Serial number of the managed system. Use the HMC's properties panel to get the managed system serial number.

7: 1
TTY's session number.

After the connection string is built, you can connect to the HMC terminal server through a socket on port 9735. After the connection is made, the connection string is sent to the virtual terminal server.

You must set the telnet mode to character. To write the ctrl ] character into a script, you must use the sequence ctrl v ctrl ].

To end the session, do one of the following:

OR

This action runs the following script:

script_name hostname port partition machine_type/model*serial session_id

where:

The following example shows how you can use a script to connect to a remote system:

#!/usr/bin/expect -f
 
system "echo [string length $argv]"
system "echo [lindex $argv 0]"
system "echo [lindex $argv 1]"
system "echo [lindex $argv 2]"
system "echo [lindex $argv 3]"
system "echo [lindex $argv 4]"
 
spawn telnet [lindex $argv 0] 9735 
 
expect "Escape"
 
 
# Note that the \r is not included in the send count
send -- "FFFX[string length $argv]*[lindex $argv 0]*
[lindex $argv 1]*[lindex $argv 2]*[lindex $argv 3]*[lindex $argv 4]\r"
 
sleep .5
        
# note: enter ^] using the sequence ctrl v ctrl ] on a unix system.send -- "^]\r"
 
 
sleep .5
 
expect "telnet"
 
send -- "mode character\r"
 
interact


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]