EXECUTING AD-HOC COMMANDS
Please make sure you have read the Ad-hoc Commands Execution section, before proceeding with this sub-section.
In this section, we will get into more details about following different topics :
- Executing Commands
- Running Commands as different user
- Interactive Command Support
Executing Commands
To run a command, make sure you are in DivineCloud Group Terminal mode. Once in Group Terminal mode, just 2 steps are required for executing any ad-hoc command:
- 1. Select Node(s) on which the command needs to be executed
- 2. Type the command and hit Enter
Executing Ad-hoc Commands Across Multiple Servers
Figure below shows the screenshot of executing "hostname" command on 75 servers in parallel:
Executing Script Across Multiple Servers
In this example let's execute a simple python script on each of the 2 servers in parallel. Script takes 2 arguments and prints the sum of the 2 numbers as output.
Figure below shows the screenshot of executing sample python scripts on the 2 servers.
The example above uses python as a language, which can easily be replaced by any other script languages including Shell Scripts, Ruby, Perl, etc.
Running Commands As Different User
To run command as different user, open the Advanced Mode form, as shown in the screenshot below and provide the appropriate details :
In addition to running commands as different users, there is also an option to provide the answers, that might be expected by the command during execution. As shown in the screenshot above, there is an option to add one or more answer in advance before executing the command, if the command expects those answers during execution.
Interactive Command Support
There might be situations where user does not know what to answer in advance before executing the command. In such situation, the Interactive Command Support available in DivineCloud is very useful. Figure below shows the screenshot of Interactive command support while executing command on 2 servers in parallel.
As indicated in the figure above, user types the answer "y" and hits enter for the situation above. The answer is then received by all the servers (whether 2 servers or 200), in parallel.
