Distributed Command Execution Manager Overview
The Distributed Command Execution Manager (DCEM) provides a variety of
services for a network of distributed machines. The DCEM graphical user
interface allows a user to construct command specifications for execution
on multiple target machines providing real-time status as commands are
executed. The user enters the command definition, runtime options, and
selected hosts and groups for a command specification and has the option
to save this command specification for future use. When a command
specification is saved, a perl script is generated that can be run directly
from a Linux or AIX command line. Groups of hosts used as targets
for a command can be created and modified directly from DCEM. These groups
can be specified by supplying host names for the group or through the use
of dynamic queries on specific attributes of hosts in a domain. DCEM also
creates a log of all distributed command activity.
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:
-
The name of the command specification.
-
A command definition including the path and command or inline script to
run on remote host machines.
-
The user name under which the command will run.
-
A description of the command.
-
A list of hosts or groups of hosts on which the command will run
-
Options for security, output streaming, and number of hosts on which to
concurrently run the command.
Command specifications that you save are stored as Perl scripts.
The saved script will contain all the information on the DCEM General and
Options tabs. Saved command specifications are located in the following
directory:
$HOME/dcem/scripts/myscripts/scripts 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.
Supported platforms
You can use DCEM to manage systems running the following operating systems:
- AIX 5L, on PowerPC
- Red Hat Linux
- Red Hat AS Linux
- SuSE Linux
- SuSE SLES Linux
Command Syntax
To start DCEM, type the following at the command line:
/opt/csm/dcem/bin/dcem
The following usage message specifies DCEM command line options:
/opt/csm/dcem/bin/dcem [-h | --help] [-V | --version] [-v |
--verbose] [-N | --groups group,group,group,...>] [-n | --hosts
<host_name,host_name,host_name,...>] [command_specification_name]
Using the dcem command with the command_specification_name option
causes DCEM to initialize the input fields in the main window with specified
command data. The command_specification_name refers to the name
used to save a command specification in the DCEM dialog. The command
defined in the command specification is sent to the specified hosts or
groups by clicking the Run button in the dialog. The Execution Progress
dialog shows the progress of the executed commands.
The following flags are also available:
The -h | --help option writes the usage message for
the dcem command to standard output.
The -V | --version option writes version information to standard
output.
The -v | --verbose option runs the
dcem command in debug
mode and writes the command's verbose messages to standard output.
The -N | --groups <group,group,group,...> option specifies
the groups displayed in the Groups of hosts field of the DCEM dialog
at startup. If this option is used with a command specification name, the
host names and groups that are stored as part of the command specification
are ignored.
The -n | --hosts <host_name,host_name,host_name,...>
option specifies the hosts displayed in Host names field of the DCEM
dialog at startup. If this option is used with a command specification
name, the host names and groups that are stored as part of the command
specification are ignored.
Examples
The following are examples for specifying hosts and groups together
with the command_specification_name parameter on the command
line. Assume the myCommand command specification was saved
with the following host names: h1, h2, h3 and groups of hosts: g1, g2,
g3.
1. To run DCEM, type:
dcem
2. To initialize the input fields with specified
command specification name and groups, type:
dcem --groups g4,g5 myCommand
This results in the
following output in the following GUI fields:
Host names:{empty}
Groups of hosts:
g4,g5
3. To initialize the input fields with specified
command specification name, groups, and hosts, type:
dcem --groups
g4,g5 --hosts h4 myCommand
This results in the
following output in the following GUI fields:
Host names: h4
Groups of hosts:
g4,g5
4. To display the version of DCEM
that is running, type:
dcem -V
Note: When running DCEM from a remote host, run the xhost
+ command on that host from the machine you are using. On the machine
running DCEM, make sure you run the export command as follows:
export DISPLAY=<IP address of the machine you are using>
Command Specification Scripts
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 C for example of
a saved command script). The saved script will contain all
the information on the DCEM General and Options tabs. 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. The script file name.pl is the name of a Perl script file
containing a saved command specification.
Command Specification Samples
Included with DCEM is a sample of command specifications that the user can use. These command samples can be found at /opt/csm/dcem/samples.
Steps to installing:
If $HOME/dcem/cmdspecs/mycmds doesn't exist type, mkdir -p $HOME/dcem/cmdspecs/mycmds
cd $HOME/dcem/cmdspecs/
Copy samplecmds.tar type, cp /opt/csm/dcem/samples/samplecmds.tar .
Untar samplecmds.tar type, tar -xvf samplecmds.tar
Copy command specification into mycmds type, cp samplecmds/<sample command specification>.* mycmds/.
Once, the desired command specification is copied into $HOME/dcem/cmdspecs/mycmds the user may view this command specification by invoking the DCEM gui and selecting browse commands.
Logs
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 dcem.log.
Distributed Command Execution Manager Dialog
The Distributed Command Execution Manager (DCEM) dialog lets you define
command specifications, then run them on one or more hosts in the Cluster
System Management (CSM) domain. This dialog is the main interface
for working with DCEM.
DCEM provides the following tabs to help you define command specifications:
-
General Tab
-
Options Tab
-
Advanced Tab
-
Groups Tab
-
Dynamic Groups Tab
The General and Options Tabs provide a user interface for creating new
command specifications and modifying previously saved command specifications. The Advanced tab allows the user to view and change DCEM options that are not directly related to running commands. The Groups and Dynamic Groups Tabs provide an interface for creating and modifying groups of host machines.
You can find more detailed help on the following elements of this window:
Run
Runs the selected command on the specified host or group of hosts.
You must complete all required fields before you can run a command specification.
Defaults
Resets the Distributed Command Execution Manager gui fields to the default values.
Save
Saves the current command specification as a script. The default
directory for saving scripts is $HOME/dcem/scripts. The saved
scripts contain all the information on the General and Options tabs of
the Distributed Command Execution Manager dialog. For example, if the name
of your command specification is "mycommand", then a perl script will be
generated, named mycommand.pl. You can then run this script, mycommand.pl,
to distribute a task across the machines specified.
Run the command specification script directly on the command line as
follows:
<user_home_directory>/dcem/scripts/myscripts/commandSpecificationName.pl
[-debug] [-non_interactive]
commandSpecificationName - is the name used to save
a command specification using the DCEM dialog.
debug - Verbose mode. Shows the actual execution string
specified, for example, /opt/csm/bin/dsh -f 11 -s -l root -N sysmgt-testbed
"date".
non_interactive - Does not prompt on the command line to run
the command. This option is useful when invoking the command script from
another script.
Close
Closing this dialog causes any commands that are still running
to be stopped. To ensure that your commands are completed on all hosts,
leave this dialog open until there are no hosts in the "Waiting" or "Working"
states on the Execution Progress dialogs.