cexec.1 (2012 03)

c
cexec(1) cexec(1)
Note: The cexec family of commands (
cps, cwall, ckill, ccp, cuptime) are based on
pdsh(8). While pdsh -S reports the worst-of exit status of remotely executed commands so
the user can determine if the command succeeded, the -S feature does not work for c shell
(csh(1)) users. Thus all commands in the
cexec family, which invoke pdsh with the -S
switch, do not report status of remotely executed commands.
When using the remote shell transport, rsh, the underlying
pdsh command stops processing the list of
hosts after encountering an unknown host. If used with the --report_loc option, therefore, the report file
will not accurately reflect the complete hostlist specified on the original command line. The ssh transport
does not have this restriction.
HOSTLIST EXPRESSIONS
cexec accepts lists of hosts in the general form: prefix[n-m,l-k,... ], where n < m and l < k, and so on, as
an alternative to explicit lists of hosts. This form is not the same as regular expression character classes
(also denoted by "[]" ). For example, node[19] does not represent an expression matching node1 or node9,
but rather the degenerate hostlist: node19.
The hostlist syntax is provided only as a convenience on clusters using a "prefixNNN" naming convention
and specification of ranges should not be considered necessary -- thus node1,node9 could be listed
specifically or as hostlist node[1,9].
EXAMPLES
Determine disk space usage cluster-wide in a Serviceguard cluster:
cexec bdf
Check memory utilization cluster-wide in Serviceguard cluster:
cexec vmstat -n | dshback -c
Bounce a daemon across a set of systems:
cexec -w node07,node09,node010 "/sbin/init.d/daemon stop; \
/sbin/init.d/daemon start"
Set a configuration variable across a set of systems:
cexec -w node7,node9 \
/usr/sbin/ch_rc -a -p CONFIGURED=1 /etc/rc.config.d/conf_file
Run command on node01,node02,...,node05 using ssh (default).
cexec -w node[01-05] command
Run command on node7, node9, node10 using rsh
cexec -w node[7,9-10] -R rsh command
Run command on node0 , node4 , node5 using ssh
cexec -w node[0-5] -x node[1-3] command
Re-run saved command on all failed nodes from saved.rpt
cexec -retry=fail saved.rpt
Note that some shells interpret brackets ([ and ]) for pattern matching. Depending on your shell, you
may need to enclose ranged lists within quotes. For example, in tcsh, the first example above should be
executed as:
cexec -w "node[01-05]" command
SEE ALSO
pdsh(1), rsh(1), ssh(1), dshbak(1), pdcp(1), ccp(1), ckill(1), cps(1), cuptime(1), cwall(1M), csshsetup(1).
HP-UX 11i Version 3: March 2012 3 Hewlett-Packard Company 3