Creating a Trigger Using the Expression Editor

The Create New Trigger screen allows you to use a graphical editor to build the JSON string that defines a trigger. You can use the expression editor section to build the tsquery statement, or you can edit the tsquery statement manually. Triggers use the tsquery language to create trigger expressions.

To create a trigger using the expression editor:

  1. Go to a service, role, role configuration group, or host configuration page and click the Create Trigger button next to the Health Test section.


    The Create New Trigger screen displays.

    As you build the trigger, the actual query text displays to the right, along with a preview of a chart returned by the query.

  2. Enter a name for the trigger in the Name field.
  3. Build the metric expressions:
    1. Select the function to use in your expression, either Last, Min, or Max.
    2. Select the metric by typing its name in the Metric field. A list of available metrics displays as you type.
    3. Select the operator, either >, >=, =, <, or <=.
    4. Enter the value to use for the comparison in the Value field.
    5. (Optional) Click the + icon to add additional expressions. Additional expressions are added to the query using the logical operator AND.
  4. (Optional) Create a predicate for the query. Under Attribute Conditions, click the + icon to add an attribute condition.

    A set of fields displays that you use to build an expression for the predicate.

    1. Type the attribute name in the Attribute field. A list of attributes displays as you type.
    2. Select the operator, either = or RLIKE.
    3. Enter the value for the comparison in the Value field.
    4. (Optional) Click the + icon to add additional expressions. Additional expressions are added to the predicate using the logical operator AND.
  5. Select an Action from the drop-down menu to define the action taken when the trigger fires:
    • Mark as bad (red)
    • Mark as concerning (yellow)
  6. Enter a value for the Stream Threshold. Leave the value set to 0 to include all streams; enter an integer to set the number of streams required to meet the condition.
  7. Select Enabled to enable the trigger. If you disable the trigger, it does not run.
  8. (Optional) Select Suppressed. A suppressed trigger still runs but does not impact the health display of the owning entity.
  9. Verify your expression:

    In the area to the right of the expression builder, in the Preview section, the expression you have built displays. A chart also displays the result of the query. Click Show Filtered Streams to see all streams. Click Hide Filtered Streams to hide streams that do not meet the stream threshold.

    You can edit your trigger using the fields in the expression builder, or you can click the Edit Manually link to display a text box in which you can manually edit the trigger. Click Use Editor to return to the expression builder.
  10. Click Create Trigger to save your trigger.