I want to run commands on many servers simultaneously. I know that mcollective, capistrano, clusterssh and pconsole are tools to quickly managed many servers simultanesouly. An example command:

du /var/log | sort -n | tail -5

I have looked into MCollective, but it is too hard and not meant for running SSH-commands directly. It seems that pconsole and clusterssh therefore would be more appropriate for me.

I know that capistrano is a very popular tool. I do wonder however, would it be good in usage cases like this? e.g.

  • test if the monitoring software is installed via a bash-command
  • yum update puppet
  • do a sed-replace in a config-file for the back-up software.

I care about getting a result after running the SSH command, so not just running the SSH command and not hearing from it again. This would help in quickly checking things on many servers simultaneously.

I know that I can use Puppet to change specific things on servers, but it's not very good at reporting statistics, e.g. what directories are using the most space on the servers.


Arguably, your monitoring tool should be able to report disk usage over time; but, if you want to run direct commands over a target group of hosts, I'd suggest to use ansible for this kind of tasks.

  • zero configuration in the servers.
  • you only need ansible installed in the machine that is going to run the commands.
  • it supports sudo.

    -K, --ask-sudo-pass
       Prompt for the password to use with --sudo, if any
  • you can define how many parallel tasks to run:

    -f NUM, --forks=NUM
       Level of parallelism.  NUM is specified as an integer, the default is 5.
  • many features, check the project web site, it is very well documented.

Another command line tool to run tasks in parallel in different hosts is GNU parallel.

  • You beat me to it. I was just about to suggest Ansible. – Tom O'Connor Sep 22 '13 at 20:25

I like using func for this, especially when combined with my func-shell. It gives you a shell that runs any command you give it on any host you want it to run.

It's not zero-config like ansible, as it requires a daemon on each server. But the good thing is that it doesn't need SSH and commands can be delegated through intermediate hosts, allowing you to use bastion hosts to use comands in many security zones.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.