Remote Execution via Universal Command - Primer
Overview
This page discusses the basics of how to execute remote work using Universal Agent.
Prior to reading this page, read the Overview of Remote execution, as this page builds upon the material presented in the Overview. The primer discussions are from the perspective of the initiating system where the Universal Command (UCMD) Manager component is executed.
The primer examples assume the Universal Agent product is installed with default configuration values to help keep the examples consistent and clear. Universal Agent must be installed both on the local system from which the UCMD Manager is executed as well as the remote system where UCMD Server is executed.
The primer examples demonstrate how to execute a command on a remote system using the Universal Command Manager component. All examples use the same set of configuration options (identified in the table below). The actual option names can be different, depending on the operating system on which the UCMD Manager executes. This difference is due to operating system conventions or standards that UCMD abides by.
Remote Execution Primer Examples
The following table describes each of the Universal Command Manager configuration options used in the primer examples illustrated on this page.
Configuration Option Name | Command Line Entry | Description |
---|---|---|
-cmd | Command to be executed on the remote system. | |
-host | Host name or IP address of the remote system on which the command is to be executed. | |
-userid | Remote user ID with which to execute the command. The user ID must be a valid user ID on the remote system. | |
-pwd | Password for the user ID on the remote system. |
Executing Universal Command Manager on z/OS
Universal Command Manager is run as a batch job step on z/OS.
A UCMD Manager JCL procedure is provided with the Universal Agent installation to simplify JCL requirements. The JCL procedure name is UCMDPRC; it is located in the SUNVSAMP product library. See the Universal Command 7.3.x Reference Guide for more information on the UCMDPRC procedure.
The following figure illustrates the JCL to execute UCMD Manager in a step. The input options are specified on the SYSIN ddname.
//S1 EXEC UCMDPRC //SYSIN DD * -cmd 'dir \' -host dallas -userid joe -pwd abcdefg /*
You will need to make the following changes to this example so that it will run in your environment:
- Change the host name dallas specified with the -host option to the host name of the remote system on which to execute the command.
- Change the user ID joe to a valid user ID on the remote system.
- Change the password value abcdefg to the password for the user ID.
When UCMD Manager is executed, it will establish network connections with UCMD Server on the remote system named dallas, and provide the specified options to the UCMD Server. UCMD Server will execute the specified command 'dir \' as user identifier joe.
The standard output of the remote command is written to the UCMD Manager UNVOUT ddname allocated in the UCMDPRC procedure. The standard error of the remote command is written to the UCMD Manager UNVERR ddname allocated in the UCMDPRC procedure. The default allocation for both UNVOUT and UNVERR is to SYSOUT. Similarly, standard input is allocated to the UNVIN ddname in the UCMDPRC. UNVIN is not utilized by the remote command being executed in this example.
The UCMD Manager will execute until the remote command completes and the UCMD Server sends the exit conditions of the remote command back to the UCMD Manager. The UCMD Manager will then end with the same exit code as the remote command.
Components
Universal Command Manager for z/OS
Executing Universal Command Manager on Windows
Universal Command Manager is run as a command on Windows.
The following command and command line options execute UCMD Manager.
ucmd -cmd 'dir \' -host dallas -userid joe -pwd password
You will need to make the following changes to this example so that it will run in your environment:
- Change the host name dallas specified with the -host option to the host name of the remote system on which to execute the command.
- Change the user ID joe to a valid user ID on the remote system.
- Change the password value abcdefg to the password for the user ID.
When UCMD Manager is executed, it will establish network connections with UCMD Server on the remote system named dallas, and provide the specified options to the UCMD Server. UCMD Server will execute the specified command 'dir \' as user identifier joe.
The standard output of the remote command is written to the standard output of UCMD Manager, which is allocated to the console window. The standard error of the remote command is written to the standard error of the UCMD Manager, which is allocated to the console window. Similarly, standard input of the remote command is read from the standard input of the UCMD Manager, which is allocated to the console windows. Standard input is not utilized by the remote command being executed in this example.
The UCMD Manager will execute until the remote command completes and the UCMD Server sends the exit conditions of the remote command back to the UCMD Manager. The UCMD Manager will then end with the same exit code as the remote command.
Components
Universal Command Manager for Windows
Executing Universal Command Manager on UNIX
Universal Command Manager is run as a shell command on UNIX.
The following command and command line options execute UCMD Manager.
ucmd -cmd 'dir \' -host dallas -userid joe -pwd password
You will need to make the following changes to this example so that it will run in your environment:
- Change the host name dallas specified with the -host option to the host name of the remote system on which to execute the command.
- Change the user ID joe to a valid user ID on the remote system.
- Change the password value abcdefg to the password for the user ID.
The ucmd program is installed by default in directory /opt/universal/bin. This directory should be added to your PATH environment variable so that the shell can find the ucmd program. Alternatively, you can specify the full path name, /opt/universal/bin/ucmd.
When UCMD Manager is executed, it will establish network connections with UCMD Server on the remote system named dallas, and provide the specified options to the UCMD Server. UCMD Server will execute the specified command 'dir \' as user identifier joe.
The standard output of the remote command is written to the standard output of UCMD Manager, which is allocated to the terminal. The standard error of the remote command is written to the standard error of the UCMD Manager, which is allocated to the terminal. Similarly, standard input of the remote command is read from the standard input of the UCMD Manager, which is allocated to the terminal. Standard input is not utilized by the remote command being executed in this example.
The UCMD Manager will execute until the remote command completes and the UCMD Server sends the exit conditions of the remote command back to the UCMD Manager. The UCMD Manager will then end with the same exit code as the remote command.
Components
Universal Command Manager for UNIX
Executing Universal Command Manager on IBM i
Universal Command Manager is run as a CL command on IBM i.
The following CL command and parameters execute UCMD Manager.
STRUCM CMD('dir \') HOST(dallas) USERID(joe) PWD(abcdefg)
You will need to make the following changes to this example so that it will run in your environment:
- Change the host name dallas specified with the HOST option to the host name of the remote system on which to execute the command.
- Change the user ID joe to a valid user ID on the remote system.
- Change the password value abcdefg to the password for the user ID.
When UCMD Manager is executed, it will establish network connections with UCMD Server on the remote system named dallas, and provide the specified options to the UCMD Server. UCMD Server will execute the specified command 'dir \' as user identifier joe.
The standard output and standard error of the remote command are written to the standard output and standard error, respectively, of UCMD Manager, which is allocated to the user's terminal for interactive sessions and to the printer file QPRINT for non-interactive jobs. Similarly, standard input of the remote command is read from the standard input of the UCMD Manager, which is allocated to the user's terminal for interactive sessions and to the QINLINE file for non-interactive jobs. Standard input is not utilized by the remote command being executed in this example.
The UCMD Manager will execute until the remote command completes and the UCMD Server sends the exit conditions of the remote command back to the UCMD Manager. The UCMD Manager will then end with an escape message if the exit condition was other than success.
Components
Universal Command Manager for IBM i
Executing Universal Command Manager on HP NonStop
Universal Command Manager is run as a TACL command.
The following command and command line options execute UCMD Manager.
run $SYSTEM.UNVBIN.ucmd -cmd 'dir \' -host dallas -userid joe -pwd password
You will need to make the following changes to this example so that it will run in your environment:
- Change the host name dallas specified with the -host option to the host name of the remote system on which to execute the command.
- Change the user ID joe to a valid user ID on the remote system.
- Change the password value abcdefg to the password for the user ID.
When UCMD Manager is executed, it will establish network connections with UCMD Server on the remote system named dallas, and provide the specified options to the UCMD Server. UCMD Server will execute the specified command 'dir \' as user identifier joe.
The standard output of the remote command is written to the standard output of UCMD Manager, which is allocated to the terminal. The standard error of the remote command is written to the standard error of the UCMD Manager, which is allocated to the terminal. Similarly, standard input of the remote command is read from the standard input of the UCMD Manager, which is allocated to the terminal. Standard input is not utilized by the remote command being executed in this example.
The UCMD Manager will execute until the remote command completes and the UCMD Server sends the exit conditions of the remote command back to the UCMD Manager. The UCMD Manager will then end with the same exit code as the remote command.
Components
/wiki/spaces/DEV/pages/1311670