Use gsh to run the same command on multiple servers

March 22, 2016 — 2 Comments

At some point you will find it very handy to be able to run the same command on multiple servers. Sure, you could just put a list of IPs in a file and run something against it using a for loop, but gsh is going to make your life much easier.

First off, i’ve used the old ‘list of ips’ way in the past – especially if I have an easy list of servers that are all the same and know that I want to group them all together. I’ve even written about it. gsh, on the other hand, will allow you to run the same command on various servers sorted by category.

We’ve written up a little guide about this at Linux Forum: https://www.linuxforum.com/threads/use-gsh-to-run-the-same-command-on-many-servers.49/




2 responses to Use gsh to run the same command on multiple servers

  1. People should check out ansible for this… Although ansible is much more powerful for running roles and full orchestration and deployment against a list of servers, it can easily execute commands like:

    ansible cent6servers -m shell -a “rpm -q openssh”

Leave a Reply