The following panels help you to define command specifications:
The General and Options panels provide an interface for creating new command specifications and modifying previously saved command specifications. The Groups and Dynamic Groups panels provide an interface for creating and modifying groups of host machines.
DCEM allows you to create, save, and edit command specifications, which reduces your time and effort when you repeatedly run the same command. A command specification consists of the following parts:
Use the following General panel to specify most of the information that is required to run commands on distributed hosts.
To create a command specification, you must provide, at a minimum, the following information in the text fields on this panel:
The following fields, which contain default values, are also required, but are populated with default values:
If you use the default $PATH in this field, the application does not delegate the local $PATH to the target hosts when the command is run. Instead, it prepends export PATH=$PATH to the command, where the $PATH variable referred to is the one set on the target machine.
To run commands found only in a specific directory, you can replace $PATH with that directory name. To guarantee that a directory is searched first, you can prepend the directory to $PATH, for example, /usr/bin:$PATH.
If you leave the Path field empty, it is the same as having $PATH.
The following field is optional and has no default:
When you create a command specification, you can also change the options for executing the commands on the distributed hosts. Use the following Options panel to view or change options.
The Options panel displays the following options:
Because the DCEM application is not interactive, you must configure a secure remote shell to run in batch mode. If a secure remote shell is not configured properly and you are prompted for a password during authentication, the command that you attempted to run cannot execute. You must then click the Stop button at the bottom of the Execution Progress dialog to stop the execution.
Options for rsh include the following:
DCEM supports a variety of secure remote shells and has been tested, to a limited basis, using RedHat OpenSSH, a secure remote shell. If a secure remote shell supports batch mode, you must enable the batch mode. You can do this either in the secure remote shell client configuration file on the CSM server or in the secure remote shell options in the DCEM Options panel. (If a secure remote shell is installed, you can select the Secure Remote Shell radio button, and in the field where the options for this selection display, you can type the flag that enables batch mode.) For detailed information about secure remote shell client configuration, see the specific secure remote shell documentation.
When you have completed entering your command specification information, click the Save button to save it as a script. Command specifications that you save are stored as Perl scripts (see Appendix A, Example of a saved command script). The saved script contains all the information on the DCEM General and Options panels. Saved command specifications are located in the following directory:
home/dcem/scripts/script file name.pl
home is the home directory of the user under whose name the distributed command is run. script file name.pl is the name of a Perl script file containing a saved command specification.
After you save a command specification, you can run it (see Running a Command on One or More Hosts Running a command on one or more hosts), view it, and select it from the Browse Command Specifications dialog.
You can run commands on multiple hosts using any of the following methods.
This displays the Browse Command Specifications dialog.
From the DCEM dialog, you can also create a new command specification (see Creating Command Specifications Creating command specifications), then click the Run button to run the selected command specification on the specified hosts or groups of hosts.
To load the command specification into the DCEM dialog directly from the command line, type the following:
/opt/csm/dcem/bin/dcem [<command_specification_name>]
Using the dcem command with the command_specification_name option causes DCEM to initialize the input fields in the General and Options panels of the DCEM dialog with specified command data. You can then click the Run button to send the command to the specified hosts.
To run the command specification script directly on the command line, type the following:
<user_home_directory>/dcem/scripts/commandSpecificationName.pl [-debug] [-non_interactive] [-format_output]
After you click the Run button to run a valid command specification or command on valid hosts or groups of hosts, DCEM displays the following Execution Progress Dialog to show the status of the command execution on all of the hosts.
In this dialog, a series of lists show hosts on which command execution is in one of the following states:
The bottom of the window displays output from the command execution on selected hosts. To display output from a host, select its name from any of the lists. Multiple selections made from the Successful or Failed lists result in combined output in the output window. To view real-time output, select a host that is currently in the working state. The Waiting and Working lists do not support multiple selections.
To stop the distributed command execution on all hosts, click the Stop button. If a command has not been completed on a host, command execution for that host is terminated. Hosts that have been stopped move to the Failed list. Command that have already completed may appear in either the Successful or Failed lists.
When the Show Errors Only check box is selected, the output area displays error messages for the selected hosts. Stdout messages are not displayed.
Selecting the Close button hides the Execution Progress Dialog, but does not stop execution on any hosts. If the DCEM dialog is closed before these hosts have completed execution, then these hosts will be stopped.
You can adjust several run-time options for your command using the DCEM Options panel, shown in the following illustration.
For example, if you are experiencing network problems and you want to improve performance, you can reduce the number of hosts on which the command specification will run at the same time. On the Options panel, the slider and the text box both display this value. The default is 32. Either of these can be modified with a new value between 1 and 64.
Note: When you change this value using the text field, the slider is only updated when the focus changes or the command is saved or run. It does not change as you type or when you press the Enter key.
You can also affect the amount of time it takes for commands to complete by selecting or deselecting the Before running, verify that host will respond check box. Selecting this check box allows you to invest the time to immediately check the host response. If there are problems, the wait time should be smaller than the minute typically taken for the remote shell command to time out.
You can change the default behavior of streaming the output (displaying it in the Execution Progress dialog as it is received) so that the output is collected and displayed for each host only after the command execution completes on that host and it is either in the successful or failed state.
You can also change the remote shell under which the commands run and specify options for that remote shell. The default remote shell is rsh.
The ability to organize hosts into groups and to save these groups for later use can make it more convenient to run commands on the same groups of hosts repeatedly. Node groups can either be explicit lists of node host names, created by explicitly specifying each host, or they can be dynamic groups of hosts, created by specifying the desired selection criteria, such as "Hostname like 'websrvr%'". To create explicit groups of hosts for use in its command specifications, use the Groups panel in the DCEM dialog. To create dynamic host groups to use in its command specifications, use the Dynamic Groups panel.
Note: By default, the root user has the authority to create groups and a non-root user cannot create groups unless special permission is set for that user. The access authority is defined in the /var/ct/cfg/ctrmc.acls file. You can modify this file, then run the refresh -s ctrmc command to refresh the systems. For more information, see the Security Considerations section of this book.
Use the Groups panel to create explicit groups of hosts. This panel provides an interface for editing, deleting, and copying the groups that you have created. The Group members list box contains a list of hosts that are already in the group.
Use the Groups panel to create a group of hosts. To create a group of hosts using the DCEM Groups panel, do the following:
Use the Groups panel to edit an existing group of hosts. You can select group members to remove host names or add new host names. To edit a group of hosts, do the following:
Use the Copy Group dialog to copy an existing group of hosts. When you copy a group, you can also add new hosts to the group or remove hosts from the group before you save the copy.
To copy a group, do the following:
Use the Groups panel to delete existing groups of hosts. To delete a group of hosts, do the following:
The Dynamic Groups panel, shown in the following illustration, allows you to create dynamic groups of hosts based on a select (SQL-like) string. This select string is used to search the hosts database to dynamically determine the list of hosts in the group.
To create a dynamic group of hosts using the DCEM Dynamic Groups panel, do the following:
To view host members of an existing dynamic group, do the following:
You can also use this feature to view hosts that satisfy the SELECT Query before actually creating a group. To do this, type the select string you want to use, then click on the Browse Hosts button. To view hosts matching a select string, you do not need to provide a group name.
Just as you cannot create a dynamic group by explicitly adding hosts to the group, you cannot edit a dynamic group by explicitly adding or removing hosts from the group. The only characteristic you can change about a dynamic group is its select string.
To edit an existing dynamic group, do the following:
To copy a dynamic group, do the following:
To delete a dynamic group, do the following:
You can write your own SQL queries to determine specific dynamic grouping criteria. By specifying the resource attribute in the SQL query, you can create a group on which a command can be run. For more information, see Setting up node group information.
DCEM command output and activity are saved in log files. Log files are stored in the following directory:
home/dcem/log/log file name
home is the home directory of the user under whose name the distributed command is run. log file name is the name of the log file containing the dcem command activity. All DCEM command activity of failures and successes are saved in this log file.
The default log file name is dcem1.log. The default maximum size for a log file is 10M. When dcem1.log is full, it is renamed to dcem2.log. New log entries are always written to dcem1.log.
The following is an example of DCEM log file contents:
TIME: Sep 20 18:55:57.076 INFO: Command Name:listing Command: ls -l Successful Machines: wsm14 wsm12 wsm06 wsm04 wsm15 wsm03 Failed Machines: wsm01 wsm00 TIME: Oct 08 11:32:10.868 INFO: Command Name:DiskSpace command: df Successful Machines: endive.austin.ibm.com Failed Machines: westwing.austin.ibm.com