The basis of each example of using the SET rule is value formats.

Example 1. Numeric values and text data are set as value.

Purposeto expand the possibilities for setting up state change conditions and to increase the visualisation level.

How to:

  1. In the monitoring section, configure the Ping probe.

    Let us be interested in the metric (packet loss perctile). For ourselves, we determined that the valid values is = 10.

  2. In the data forming rules, configure the condition and the action:

    if  = [0; 10], then the  metric with the value OK is written to the data table.

    The structure of conditions entry is similar to the textual represantation of the state change conditions.

    Create the necessary conditin in the "State change conditions" section, then switch the graphic editor to the text view using the button and copy the condition into the "Data forming rules" section.

    A grafic constructor will appear soon (smile)

    [
      {
        "condition": {
            "packetLossPercentile": {
            "_eq": "[0;10]"
          }
          },
        "actions": [
          {
            "type": "set",
            "field": "packetLossPercentile",
            "value": "OK"
          }
        ]
      }
    ]
  3. In the state change conditions, specify:
    if  = OK, then the object changes the state to the  state.
  4. In the data forming rules, configure the condition and the action:
    if  > 10, then the  metric with the value warning is written to the data table.

    [
      {
        "condition": {
            "packetLossPercentile": {
            "_gt": "10"
          }
          },
        "actions": [
          {
            "type": "set",
            "field": "packetLossPercentile",
            "value": "warning"
          }
        ]
      }
    ]
  5. In the state change conditions, specify:
    if  = warning, then the object changes the state to the  state. And it is not priority to solve by the technical support.
  6. In the data forming rules, configure the condition and the action:
    if  > 10 and tkis value came more than once, then the  metric with the value alert is written to the data table.

    [
      {
        "condition": {
          "packetLossPercentile": {
            "_gt": "10"
          }
        },
        "actions": [
          {
            "type": "extend",
            "include": "over_packetLossPercentile"
          }
        ]
      },
      {
        "actions": [
          {
            "type": "set",
            "field": "over_packetLossPercentile",
            "value": "1"
          }
        ]
      },
      {
        "condition": {
          "packetLossPercentile": {
            "_gt": "10"
          },
          "over_packetLossPercentile": {
            "_eq": "1"
          }
        },
        "actions": [
          {
            "type": "set",
            "field": "packetLossPercentile",
            "value": "alert"
          },
          {
            "type": "drop",
            "include": [
              "over_packetLossPercentile"
            ]
          }
        ]
      }
    ]
  7. In the state change conditions, specify:
    if  = alert, then the object changes the state to the  state. And it requires immediate intervention from the techinal support.

This method allows you to increase the level of visualization in widgets.



Example 2. Formulas using metrics from a data table with current and new pointers are set as value.

Purpose: to get the display of stepping values.

How to:

  1. In the Monitoring section, configure the process by name probe.

    Let us be interested in changing the metric (total process resident memory) in a single process. It is the difference between the the new value and the current one: {{new.bytesResident}} - {{current.bytesResident}}.


  2. In the ahent data forming rules, create a new metric last_diff (difference) and set the formula in the value:

    [
      {
        "actions": [
          {
            "type": "set",
            "field": "last_diff",
            "value": "{{new.bytesResident}}-{{current.bytesResident}}"
          }
        ]
      }
    ]