|
|
This chapter describes how to use the Cisco IOS for S/390 Remote Executor. It includes these sections:
The Remote Executor, TCPREXEC, uses the REMCMND program to execute a command on a foreign host and receive results on the local host. You can use the TSO command TCPREXEC or you can run TCPREXEC in batch mode using a JCL.
This product uses version 5.5 of SAS C.
The REMCMND program lets you execute a command on a remote host and receive results on the local host. The REMCMND program can be executed from the TSO command line or from a batch job using a JCL.
An REXEC daemon must be running on the host. The REMCMND client passes the user name, password, and command to the REXEC daemon. The daemon provides logon and user authentication, depending on the parameters set by the user. If authentication fails, an error message displays on the local host.
When executing REMCMND interactively under TSO, you must invoke a REXX EXEC called TCPREXEC to dynamically allocate statements and files. TCPREXEC passes command-line arguments to the host in as-is format (overriding the TSO function which makes all arguments uppercase). The TCPREXEC REXX EXEC is contained in the SAMP library. Copy it to a system CLIST or REXX library to use it.
To execute a command on the foreign host and receive the results on the local host, use the TCPREXEC command as shown here:
TCPREXEC ' {USER (username)}| USER | Specifies the user ID on the foreign host. The default user name (if you wait for the prompt) is your TSO user ID, in upper case. If your user ID is the same on the host system but in lower case, it must be retyped (in lower case). If this parameter is not supplied, you will be prompted for it. |
| PASS | Specifies the password of the user ID on the foreign host. Do not specify PASS() on the command line if no password is used. If prompted for a password, just press the enter key. If this parameter is not supplied, you will be prompted for it. |
| SUBSYS | Specifies a particular Cisco IOS for S/390 gateway rather than the default ACSS. This parameter is optional. |
| hostname | The name of the foreign host that is the target of the REMCMND command. hostname can be a fully qualified name or alias, or the IP net address, in the form nnn.nnn.nnn.nnn. This parameter is required. |
| command_string | The command sent to the foreign host, composed of one or more words. The code checks for the user name, password, subsystem ID, and host name, then assigns the remaining string as the command. |
REMCMND uses a NETRC (user.FTP.NETRC on MVS) file if you provide one. The NETRC file contains the host name, user ID, and password for multiple machines on your network. It takes this format:
MACHINE hostnameUse this sequence of MACHINE, LOGIN, PASSWORD for each of the hosts you want to connect to.
TSO prepends the current local user ID to FTP.NETRC, then searches the MVS catalog for that file. When TCPREXEC finds user.FTP.NETRC, it reads that data set, looking for the machine name you requested (hostname). When a match is found TCPREXEC reads the login and password statements and uses those for authentication to the remote host.
To have the TCPREXEC program scan your NETRC file for a machine with the host name snoopy, enter this TCPREXEC command:
TCPREXEC snoopy ls -lIn this command, snoopy is the host name and ls -l is the command string.
If TCPREXEC does not find user.FTP.NETRC, or does not find the host name in the file, it prompts for the user name and password.
To run REMCMND in batch mode, you must include information in a JCL stream.
If you want to run in batch mode, use the JCL in this example. This example JCL issues an ls -l command on the remote host hostname.
//REMCMND JOB //JS01 EXEC PGM=REMCMND, // PARM='USER(username) PASS(password) hostname ls -l' //STEPLIB DD DISP=SHR,DSN=T01TCP.LINK // DD DISP=SHR,DSN=T01TCP.LOAD //SYSPRINT DD SYSOUT=A //SYSTERM DD SYSOUT=A //OUTPUT DD SYSOUT=A
Output received from the command executed by program REMCMND is written to the OUTPUT DD statement.
When you run REMCMND in batch mode, REMCMND does not automatically read your NETRC file as it does for the interactive TSO command TCPREXEC. In batch mode, you must include a NETRC statement in your JCL.
The next example uses the user.FTP.NETRC file to provide the user name and password.
//REMCMND JOB //JS01 EXEC PGM=REMCMND,PARM='hostname ls -l' //STEPLIB DD DISP=SHR,DSN=T01TCP.LINK // DD DISP=SHR,DSN=T01TCP.LOAD //NETRC DD DSN=uid.FTP.NETRC,DISP=SHR //SYSPRINT DD SYSOUT=A //SYSTERM DD SYSOUT=A //OUTPUT DD SYSOUT=A
You can use the PARM option on the EXEC statement to pass information to the REMCMND program.
//JS01 EXEC PGM=REMCMND,PARM='host_name cmnd_string'
On many systems, you can string several commands together on the same line. For example, on UNIX, you can issue two commands on the same line by separating the commands with the semicolon (;) as a delimiter.
You can use this facility with REMCMND in batch files.
//JS01 EXEC PGM=REMCMND,PARM='hostname ls;date'
If the parameter field on the EXEC statement is blank, REMCMND looks for a SYSIN DD statement in the batch JCL. REMCMND reads an 80 byte card from SYSIN and parses it like the command-line arguments.
Include information for username, password, hostname, and command_string in the JCL as shown in this example:
//REMCMND JOB //JS01 EXEC PGM=REMCMND //STEPLIB DD DISP=SHR,DSN=T01TCP.LINK // DD DISP=SHR,DSN=T01TCP.LOAD //SYSPRINT DD SYSOUT=A //SYSTERM DD SYSOUT=A //OUTPUT DD SYSOUT=A //SYSIN DD *user_namepasswordhost_namecmnd_string//
For frequently used commands, you can include this line in the JCL to create a control file with the pertinent information:
USER(user_name) PASS(password) zulu exec /usr/openwin/bin/xioctetn \ -server telnet -host mvshost -title REMCMND
Caution Due to parsing limitations, the input statement specified via SYSIN must not contain sequence numbers in columns 72 through 80, since it will be sent as data to the remote host and cause an error.
|
|