Execute commands on Multiple UNIX servers
To get the output from single server we can get it very easily by just executing particular command but what if we would like execute commands on multiple UNIX servers.
Use ssh to fulfill above requirement of remote execution.
System Scenario:
kalwa1 ip 192.168.216.130
kalwa2 ip 192.168.216.131
SSH client is a program for logging into a remote machine and for executing commands on a remote machine. If command is specified, command is executed on the remote host instead of a login shell.
By using ssh client we can execute remote command on server.(username is ‘manmohan’)
$ ssh manmohan@192.168.216.131 df
Above command will gather up all mount point information. However if you put this command in script to gather information from three server as follows it will prompt for a password:
ssh manmohan@192.168.216.131 df
ssh manmohan@192.168.216.132 df
ssh manmohan@192.168.216.133 df
Leave a Reply