gtm trigger
The gtm trigger command manages the trigger profiles that define the operations to be run outwards while a health scenario is becoming active or passive: sending an HTTP request or running a command in a database. Its panel equivalent is the Trigger Actions screen.
A trigger does not run on its own; it is bound to the activation or deactivation direction of a scenario and runs when that direction is triggered.
Command Summary
Required Fields
| Order | Field | Status | Value |
|---|---|---|---|
| 1 | name | Required | The name of the trigger profile |
| 2 | triggerType | Required | http · https · oracle |
| 3 | addr.ip | Conditionally required | Only http and https; the address the trigger will go to |
| 4 | addr.port | Conditionally required | Only http and https; the target port |
| 3–5 | oracleUser · oraclePassword · oracleConnectionString | Conditionally required | Only oracle; in this type the address and the port are not asked for, it is set up with the connection string |
The oraclePassword is not written on the command line; after the command is run, it is asked for on the screen without being seen.
The Common Fields
| Field | Default | Value |
|---|---|---|
--v-device | The Host device | From which virtual device the trigger will be sent |
--namespace | The default route table of the device | From which route table the trigger will be sent |
The HTTP and HTTPS Trigger
| Field | Default | Value |
|---|---|---|
--uri | — | The path and the query to be requested |
--method | GET | The request method |
--httpBody | — | The request body |
--httpHeaders.0.name · --httpHeaders.0.value | — | The request headers |
--expectedStatusCodes.0 | 200 | The status codes at which the trigger will count as successful |
--contentQuery | — | The expression to be searched for in the answer content |
The Oracle Trigger
In the Oracle type the trigger consists of steps that run in order. Every step takes its own index.
| Field | Value |
|---|---|
--oracleScenario.0.oracleAction | The type of the step: executeCmd or wait |
--oracleScenario.0.oracleCmd | The command to be run; only in the executeCmd step |
--oracleScenario.0.oracleExpectedText | The text expected in the answer; only in the executeCmd step |
--oracleScenario.0.oracleExpectedMinRows | The least number of rows expected; only in the executeCmd step |
--oracleScenario.0.oracleWaitMs | The duration to be waited; only in the wait step |
Binding the Trigger to a Scenario
The same binding is done for the deactivation direction with the --triggerReturn on --triggerReturnActions.0 fields.
Updating and Deleting
The type can be changed in an update as well; when it is changed, the required fields of the new type have to be given too.
Things to Know
- A trigger does not run without being bound to a scenario. It has to be added to the activation or deactivation direction of a scenario.
- The actions run in order. If there is more than one trigger in a scenario, they are operated in the order in the list; an action that fails stops the ones after it.
- The Oracle password is asked for hidden. The other fields are written on the line.
- The success criterion changes according to the type. On the HTTP side the status code and the content expression, and on the Oracle side the expected text and the number of rows are used.
