Go to main content

Developing Data Services

Exit Print View

Updated: August 2018

Using the Agent Builder Korn Shell-Based $hostnames Variable

For many applications, specifically network-aware applications, the host name on which the application listens and services customer requests must be passed to the application on the command line. In many cases, the host name is an argument that you must specify for start, stop, and probe commands for the target resource type on the Configure screen. However, the host name on which an application listens is cluster specific. The host name is determined when the resource is run on a cluster. The host name cannot be determined when Agent Builder generates your resource type code.

To solve this problem, Agent Builder provides the $hostnames variable that you can specify on the command line for the start, stop, and probe commands.

Note - The $hostnames variable is supported for use with Korn shell-based services only. The $hostnames variable is not supported for use with C-based and GDS-based services.

You specify the $hostnames variable exactly as you would an actual host name, for example:

% /opt/network_aware/echo_server -p port-no -l $hostnames

When a resource of the target resource type is run on a cluster, the LogicalHostname or SharedAddress host name that is configured for that resource is substituted for the value of the $hostnames variable. The host name is configured for that resource in the Network_resources_used resource property of the resource.

If you configure the Network_resources_used property with multiple host names, the $hostnames variable contains all host names, each host name separated by a comma.