[ Home ]

Use dsh to exec commands on many machines

For this example, I will try to get the total memory of all my servers:

$ cat myserverlist.txt
127.168.1.24
127.168.1.25
127.168.1.26
$ dsh -r ssh -f backendstate.txt -M -- grep MemTotal /proc/meminfo
127.168.1.24: MemTotal:       35058204 kB
127.168.1.25: MemTotal:       35058204 kB
127.168.1.26: MemTotal:       35058208 kB