Version 11 (modified by 17 years ago) ( diff ) | ,
---|
Go back —> Tutorials
Tutorial TOC
How to use execute a shell command on the nodes
Prerequisite
This feature is only available in NodeHandler v4 and above.
Before going through this tutorial, you should know the basics of writing and running an experiment script (see here and here).
You should also have installed a disk image with Node Agent v4 on the nodes of the testbed you are using (e.g. "baseline.ndz"). See How to install a disk image.
Goal
In this tutorial, you will learn a simple way to run a shell commands on the nodes of a testbed.
The tutorial experiment
This experiment is given in the attached script tut_cmd_1.rb.
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. It also shows how you could process the command outputs, e.g. redirect them to a text file.
To run this example script, use the following command:
orbit exec tut_cmd_1
The Results
The experiment screen output should then look like this. And the experiment log file should look like this.
More…
This method of executing a shell command on nodes is well suited for one-off or temporary experiments. If you plan on re-using or sharing the same commands among multiple experiment scripts, then you should consider this other method which uses application definition.
Attachments (3)
- sb1_2007_11_19_18_45_06-Output.txt (4.7 KB ) - added by 17 years ago.
- sb1_2007_11_19_18_45_06.log (34.0 KB ) - added by 17 years ago.
- tut_cmd_1.rb (1.7 KB ) - added by 17 years ago.
Download all attachments as: .zip