GT 4.0 WS MDS Aggregator Framework: Configuring the Execution Aggregator Source

1. Introduction

The execution aggregation source provides a way to aggregate data (arbitrary XML information) about a registered resource using an arbitrary local executable (such as an external script). The executable will be passed registration information as parameters and is expected to output the gathered data, as detailed below.

A basic example of the use of this API is described in the ping test example for the aggregator execution source

The execution aggregation source will periodically execute an identified executable. The identity of the executable and the frequency with which it is to run are specified in the registration message.

2. Registering

To register resources:

  • Create a configuration file in XML that specifies registrations. See $GLOBUS_LOCATION/etc/globus_wsrf_mds_aggregator/example-aggregator-registration.xml for several specific examples.
  • Run mds-servicegroup-add to perform the registrations specified in that configuration file.

The file consists of an optional defaultServiceGroupEPR, an optional defaultRegistrantEPR, and then one or more ServiceGroupRegistrationParameters blocks, each of which represents one registration.

The general syntax of the configuration file is:


<?xml version="1.0" encoding="UTF-8" ?>
<ServiceGroupRegistrations
  xmlns="http://mds.globus.org/servicegroup/client">

  // An optional default service group EPR.
  <defaultServiceGroupEPR>
    // Default service group EPR
  </defaultServiceGroupEPR>

  // An optional default registrant EPR.
  <defaultRegistrantEPR>
    // Default registrant EPR
  </defaultRegistrantEPR>

  // An optional default security descriptor file.
  <defaultSecurityDescriptorFile>
    // Path name of default security descriptor file
  </defaultSecurityDescriptorFile>

  // One or more service group registration blocks:

  <ServiceGroupRegistrationParameters>
    <ServiceGroupEPR>
      // EPR of the service group to register to
    </ServiceGroupEPR>
    <RegistrantEPR>
      // EPR of the entity to be monitored.
    </RegistrantEPR>
    <InitialTerminationTime>
      // Initial termination time
    </InitialTerminationTime>
    <RefreshIntervalSecs>
      // Refresh interval, in seconds
    </RefreshIntervalSecs>
    <Content type="agg:AggregatorContent">
      // Aggregator-source-specific configuration parameters
    </Content>
  </ServiceGroupRegistrationParameters>

</ServiceGroupRegistrations>

The following table describes the different blocks of the file and any parameters:

Table 1. Aggregator configuration parameters

defaultServiceGroupEPR blockThe provides a convenient way to register a number of resources to a single service group -- for example, if you wish to register several resources to your default VO index, you can specify that index as the default service group and omit the ServiceGroupEPR blocks from each ServiceGroupRegistrationParameters block.
defaultRegistrantEPRThe provides a convenient way to register a single resource to several service groups -- for example, if you wish to register your local GRAM server to several index servers, you can specify your GRAM server as the default registrant and omit the RegistrantEPR blocks from each ServiceGroupRegistrationParameters block.
defaultSecurityDescriptorFileSimply the path to the security descriptor file.
ServiceGroupRegistrationParametersEach ServiceGroupRegistrationParameters block specifies the parameters used to register a resource to a service group. The parameters specified in this block are:
ServiceGroupEPRThe EPR of the service group to register to. This parameter may be omitted if a defaultServiceGroupEPR block is specified; in this case, the value of defaultServiceGroupEPR will be used instead.
RegistrantEPRThe EPR of the resource to register. This parameter may be omitted if a defaultRegistrantEPR block is specified; in this case, the value of defaultRegistrantEPR will be used instead.
InitialTerminationTimeThe initial termination time of this registration (this may be omitted). If the initial termination time is omitted, then the mds-servicegroup-add sets the initial termination time to the current wall time plus 2 times that of the specified RefreshIntervalSecs parameter.
RefreshIntervalSecsThe refresh interval of the registration, in seconds. The mds-servicegroup-add will attempt to refresh the registration according to this interval, by default incrementing the termination time of the registration by 2 times this interval for every successful refresh. If at any point the termination time for the registration expires the registration will be subject to removal within a maximum of 5 minutes.
ContentAggregator-source-specific registration parameters. The content blocks for the various aggregator sources are described in detail in the following sections.

3. 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>

4. 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.

5. Configuring the executable

5.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.

5.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).

5.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.