| 1 | |
| 2 | Go back --> [wiki:Tutorial Tutorials] |
| 3 | |
| 4 | == How to use execute a shell command on the nodes == |
| 5 | |
| 6 | This feature is only available in NodeHandler v4 and above. |
| 7 | |
| 8 | Before going through this tutorial, you should know [wiki:Tutorial/HowToImage how to install a disk image]. |
| 9 | |
| 10 | You should also have installed a disk image with Node Agent v4 on the nodes of the testbed you are using (e.g. "baseline-7.11.ndz"). |
| 11 | |
| 12 | === Goal === |
| 13 | |
| 14 | In this tutorial, you will learn a simple way to run a shell commands on the nodes of a testbed. |
| 15 | |
| 16 | === The tutorial experiment === |
| 17 | |
| 18 | This experiment is given in the attached script [attachment:tut_cmd_1.rb tut_cmd_1.rb]. |
| 19 | |
| 20 | This file contains extensive comments that should help you understand the different steps involved in executing a shell command on the nodes of a testbed. For more information on the basics of writing and using an experiment script, please refer to the previous tutorials, [wiki:Tutorial/HowtoWriteScripts here] and [wiki:Tutorial/HelloWorld here]. |
| 21 | |
| 22 | To run this example script, use the following command: |
| 23 | |
| 24 | {{{ |
| 25 | nodehandler4 tut_cmd_1 |
| 26 | }}} |
| 27 | |
| 28 | (This assumes that you previously logged in to the a testbed, and imaged its nodes with the a disk image such as "baseline-7.11.ndz".) |
| 29 | |
| 30 | === The Results === |
| 31 | |
| 32 | The experiment screen output should then look like [attachment:grid_2007_08_27_20_45_37-Output.txt this]. And the experiment log file should look like [attachment:grid_2007_08_27_20_45_37.log this]. |
| 33 | |
| 34 | === More... === |
| 35 | |
| 36 | This other script [attachment:tut_topo_1_more.rb tut_topo_1_more.rb] contains an extended version of the above script with more optional features. |