wlanboy
Content Contributer
I am running three mail servers for different domains. Therefore I often check them at the same time.
It is a pain in my head to run the same commands on different terminal windows again and again.
So I searched for a tool that can handle this. And I found clusterssh.
Installation is easy:
sudo apt-get install clusterssh
or
sudo yum install clusterssh
Configuration can be done system wide (/etc/clusters) or per user (~/.csshrc). I prefer the second option.
nano ~/.csshrc
clusters = mail_servers mongodb_cluster ruby_workers
mail_servers =vps1 vps2 vps3
mongodb_cluster = vps4 vps5 vps6 vps7
ruby_workers = vps8 vps9
You can define "clusters" which simple are groups of hostnames
If you combine that with you ssh client config
nano ~/.ssh/config
Host vps1
HostName 192.1.1.1
Port 22
User myuser
IdentityFile ~/.ssh/id_myuser_vps1
[...]
You just have to type in:
cssh mail_servers
And clusterssh open 3 xterm windows and opens the connection to the three hosts.
An additional window will open too:
Every command typed into this window will be forwarded to all ssh connections.
You can even deselect hosts or add new hosts or clusters on runtime.
Another shortcut is to just add the hosts as parameters:
cssh vps1 vps 5 vps7 vps8
Add "--help" to see all the options.
One of my fav time saver toos.
It is a pain in my head to run the same commands on different terminal windows again and again.
So I searched for a tool that can handle this. And I found clusterssh.
Installation is easy:
sudo apt-get install clusterssh
or
sudo yum install clusterssh
Configuration can be done system wide (/etc/clusters) or per user (~/.csshrc). I prefer the second option.
nano ~/.csshrc
clusters = mail_servers mongodb_cluster ruby_workers
mail_servers =vps1 vps2 vps3
mongodb_cluster = vps4 vps5 vps6 vps7
ruby_workers = vps8 vps9
You can define "clusters" which simple are groups of hostnames
If you combine that with you ssh client config
nano ~/.ssh/config
Host vps1
HostName 192.1.1.1
Port 22
User myuser
IdentityFile ~/.ssh/id_myuser_vps1
[...]
You just have to type in:
cssh mail_servers
And clusterssh open 3 xterm windows and opens the connection to the three hosts.
An additional window will open too:
Every command typed into this window will be forwarded to all ssh connections.
You can even deselect hosts or add new hosts or clusters on runtime.
Another shortcut is to just add the hosts as parameters:
cssh vps1 vps 5 vps7 vps8
Add "--help" to see all the options.
One of my fav time saver toos.