Configuring Execution Aggregator Source

The ExecutionAggregatorSource requires more configuration than Query and Subscription. In addition to the config file parameters, you must also configure the executable itself. Troubleshooting info and an example are also provided.

1. Configuration file: parameters for the execution aggregator source

The configuration block for ExecutionAggregatorSource (inside the Content block) looks like this:

                <Content xsi:type="agg:AggregatorContent"
                xmlns:agg="http://mds.globus.org/aggregator/types">
                <agg:AggregatorConfig xsi:type="agg:AggregatorConfig">
                <agg:ExecutionPollType>
                <agg:PollIntervalMillis>interval_in_ms</agg:PollIntervalMillis>
                <agg:ProbeName>dummy_namespace:probe_name</agg:ProbeName>
                </agg:ExecutionPollType>
                </agg:AggregatorConfig>
                <agg:AggregatorData/>
                </Content>
            

where:

PollIntervalMillis

This parameter is the poll refresh period in milliseconds.

ProbeName

This parameter specifies name of the probe to run. This probe is defined in the jndi-config.xml file for the service being configured (for example, the file for the MDS Index Service is $GLOBUS_LOCATION/etc/globus_wsrf_mds_index_jndi-config.xml). An executableMappings parameter should be defined within this file to map probe names to executable names. For example, this maps the probe names aggr-test and pingexec to the executables called aggregator-exec-test.sh and example-ping-exec, respectively. All executables are presumed to be in the directory $GLOBUS_LOCATION/libexec/aggrexec.

                            <resource name="configuration"
                            type="org.globus.mds.aggregator.impl.AggregatorConfiguration">
                            <resourceParams>
                            // ...
                            <parameter>
                            <name>executableMappings</name>
                            <value>aggr-test=aggregator-exec-test.sh, pingexec=example-ping-exec</value>
                            </parameter>
                            </resourceParams>
                            </resource>
                        

2. Troubleshooting

If you've properly configured and registered your script for execution but are getting errors from the container because it cannot find the specified script, there are two likely causes.

First, make sure that your script/program is executable and is located in the $GLOBUS_LOCATION/libexec/aggrexec directory. When it's specified in the configuration mentioned above, only specify the name of the script/program, without any qualification or path. For example, using the ProbeName as test-script will be specifying the file $GLOBUS_LOCATION/libexec/aggrexec/test-script script.

Next, make sure that you have correctly created an executableMappings definition in the appropriate jndi-config.xml file.

3. Configuring the executable

3.1. Name of executable

The executable to run will be $GLOBUS_LOCATION/libexec/aggrexec/<scriptname> with scriptname supplied by the ProbeName parameter in the configuration file.

3.2. Input to executable

Information about the registration will be supplied as command line parameters and on stdin.

A single command line parameter will be supplied to the executable. This will be the URL from the EPR of the registered service.

Two XML documents will be sent to stdin, in sequence:

  1. The first document will be the full EPR to the registered service.
  2. The second document will be the AggregatorConfig block from the registration message (configuration file).

3.3. Output from executable

The executable must output a well-formed XML document to stdout. This output document will be delivered into the Aggregator Framework.

4. Ping test example

4.1. Introduction

This file describes an example of using the Execution Aggregator Source API.

The example provides basic ping information about a registrant. It is intended for illustrative purposes, rather than real deployment use.

The aggregator framework is used by other services to collect information. In this example, it will be shown how to configure the index service to use the execution aggregator source.

4.2. Deploying the example

4.2.1. Install the example script in the correct location.

The example script is installed as: $GLOBUS_LOCATION/etc/globus_wsrf_mds_aggregator/example-ping-exec. It is necessary to copy this to the directory where the execution source will look for executables, and ensure that it's executable:

 
                        $ cp $GLOBUS_LOCATION/etc/globus_wsrf_mds_aggregator/example-ping-exec \
                        $GLOBUS_LOCATION/libexec/aggrexec/. $ chmod a+x
                        $GLOBUS_LOCATION/libexec/aggrexec/example-ping-exec
                    

4.2.2. Configure the index to use the execution source.

By default, the index is configured to use a WS-Resource Properties polling mechanism. It is necessary for this example to change the index configuration to use the execution source instead.

4.2.3. Register some resources.

This can be achieved using the mds-servicegroup-add tool.

Rather than configuring the client to register with parameters for the Resource Property polling source, parameters for the execution source should be supplied in each registration.

Register both resources that you know exist, and also some non-existent resources.

4.2.4. Observe the results.

Start the container hosting the index, start the mds-servicegroup-add tool, then query the contents of the index with:

$ wsrf-query -s http://localhost:8080/wsrf/services/DefaultIndexService '/*'

Each registration should be represented as an Entry resource property value in the output of wsrf-query; embedded in each entry should be an $examplePingResult element with the results of ping testing.