Managing Systems and Workgroups: A Guide for HP-UX System Administrators
Configuring a System
Using Distributed Systems Administration Utilities
Chapter 3 239
Parallel Distributed Shell
The Distributed Systems Administration Utilities (DSAU) include the
open souce tool Parallel Distributed Shell (pdsh). pdsh formalizes the use
of remsh and ssh for distributing commands to groups of systems. Unlike
remsh/ssh wrappers, pdsh offers the following benefits:
• High performance
Commands are issued in parallel to groups of target system. pdsh
supports a sliding window or fanout setting to control the number of
concurrent commands.
• Command timeout settings
pdsh supports a command execution timeout which controls how long
a remote command can execute before being disconnected (to prevent
problem commands from hanging). It also supports a connect
timeout which prevents blocking when remote systems are
unreachable.
• Output processing and return status
pdsh correctly handles stdout and stderr processing and supports
returning a “worst of”return status so the caller can detect errors
from remote systems.
• Flexible target system specifications
pdsh supports several mechanisms for specifying the target hosts on
which to operate. They can be specified on the command line, on
stdin, in a well known file (/etc/machines) or in a file pointed to by
the WCOLL environment variable. Specific systems can be excluded
from the command line as well.
• Hostlist expressions
For groups of systems using a
prefixNNN
naming convention (for
example, h1, h2, ..., h
N
), pdsh allows target nodes specification using
hostlist expressions such as “h[1-10]” which would fan out a
command to hosts named h1 through h10.
• Intelligent output filtering
pdsh prefaces each line of output with the hostname of originating
system. dshbak (see dshbak (8)) is a filter that can format the
standard pdsh output in several different ways. The dshbak -c flag
looks for output from different hosts that is identical and
consolidates the output instead of duplicating it. The header will
indicate the hosts to which the consolidated output applies.