Back to Geneos FAQ

Setting the Gateway Hostname as a Variable in Geneos

Problem Copied

In Geneos, users may need to reference the hostname of the Gateway server as a variable, typically for use in Sampler Toolkit scripts or conditional configuration logic. However, there is no built-in ${gatewayHostname} macros available like ${gatewayName}

Solution Copied

The Gateway hostname must be manually defined as a variable, as it isn’t available by default.

Example:

GSE > Environments > Geneos

Geneos - Setting the Gateway Hostname as a Variable in Geneos

Set the Env on your sampler where the toolkit is used:

Geneos - Setting the Gateway Hostname as a Variable in Geneos

Toolkit plugin setup:

Geneos - Setting the Gateway Hostname as a Variable in Geneos

Output:

Geneos - Setting the Gateway Hostname as a Variable in Geneos

In Rules: If you’ve defined a variable containing the hostname, you can access it when creating a rule. In the rule setup window, right-click in the blank area, select Variables, and you should see your defined variable listed for use in the expression.

Geneos - Setting the Gateway Hostname as a Variable in Geneos

Note: The variables can be defined in managed entities, managed entity groups, types, environments, and operating environment: https://docs.itrsgroup.com/docs/geneos/current/processing/gateway-administration/gateway_user_variables_and_environments/index.html#define-variables

["Geneos"] ["Geneos > Gateway"] ["FAQ"]

Was this topic helpful?