3 running a command on multiple managed systems – HP Insight Control Software for Linux User Manual
Page 198
19.3 Running a command on multiple managed systems
The open source Parallel Distributed Shell (
) command is a multi-threaded remote shell
client that runs commands on multiple managed systems in parallel. You can specify all, a given
number of, or only certain managed systems on which to perform the command or commands
that are passed as arguments to the pdsh command.
All three forms of managed system names can be used by the pdsh command.
By default, the pdsh shell can issue 32 simultaneous remote commands at a time. You can override
this default with the -f option.
The pdsh shell relies on SSH transport mechanism. Ensure that SSH is properly installed on the
system; changes to the SSH configuration can cause the pdsh shell to fail. Although the pdsh
shell can use several remote shell services, including rsh and
, the security settings for Insight
Control for Linux make ssh the shell of choice.
The syntax of the pdsh command is:
pdsh -[options] "command_to_run"
Use the pdsh --help option to view command-line options, as follows:
# pdsh --help
Usage: pdsh <-options> command ...
-S return largest of remote command return values
-h output usage menu and quit
-V output version information and quit
-q list the option settings and quit
-b disable ^C status feature (batch mode)
-d enable extra debug information from ^C status
-l user execute remote commands as user
-t seconds set connect timeout (default is 10 sec)
-u seconds set command timeout (no default)
-f n use fanout of n nodes
-w host,host,... set target node list on command line
-x host,host,... set node exclusion list on command line
-R name set rcmd module to name
-L list info on all loaded modules and exit
-a target all nodes
available rcmd modules: ssh
--domain domain Domain specification, use --help domain
IMPORTANT:
Do not pass a command that requires interaction as an argument to the pdsh
command. Prompting from the remote system can cause the command to hang.
pdsh Command Examples
•
The -a option runs the uptime command on all managed systems:
# pdsh -a "uptime"
eris: 08:46:53 up 17:45, 0 users, load average: 0.05, 0.05, 0.00
mars: 19:03:14 up 17:44, 0 users, load average: 0.04, 0.04, 0.00
earth: 14:35:14 up 17:44, 0 users, load average: 0.01, 0.02, 0.00
mercury: 09:29:03 up 20:29, 2 users, load average: 0.06, 0.10, 0.09
pluto: 14:24:51 up 17:45, 0 users, load average: 0.01, 0.04, 0.00
198
Using SSH for remote server management