# 1. Define an OMF Application Definition for the ping-oml2 application # The OMF entities are using this definition to know where to find the # application, what are its configurable parameters, and what are the # OML2 measurement points that it provides. # This ping-oml2 application will be known by OMF entities as 'ping_oml2' # defApplication('simple_ping') do |app| app.description = 'Simple Definition for the simple_ping application' # Define the path to the binary executable for this application app.binary_path = '/bin/ping' # Define the configurable parameters for this application # For example if target is set to foo.com and count is set to 2, then the # application will be started with the command line: # /bin/ping -a foo.com -c 2 app.defProperty('target', 'Address to ping', '', {:type => :string}) app.defProperty('count', 'Number of times to ping', '-c', {:type => :integer}) end # 2. Define a group of resources which will run the ping-oml2 application # Here we define only one group (Sender), which has only one resource in it # (node11) # ##### UPDATE THIS SCRIPT WITH NODE NAME THAT YOU HAVE RESERVED ########### defGroup('Sender', 'node11') do |g| # Associate the application ping_oml2 defined above to each resources # in this group g.addApplication("simple_ping") do |app| # Configure the parameters for the ping_oml2 application app.setProperty('target', '8.8.8.8') app.setProperty('count', 3) # Request the ping_oml2 application to collect measurement samples # from the 'ping' measuremnt point (as defined above), and send them # to an OML2 collection point app.measure('ping', :samples => 1) end end # 3. Define the sequence of tasks to perform when the event # "all resources are up and all applications are install" is being triggered # onEvent(:ALL_UP_AND_INSTALLED) do |event| # Print some information message info "This is my first OMF experiment" # Start all the Applications associated to all the Groups allGroups.startApplications # Wait for 5 sec # Stop all the Applications associated to all the Groups after 15 do allGroups.stopApplications end # Tell the Experiment Controller to terminate the experiment now after 10 do Experiment.done end end