Support Center > Search Results > SecureKnowledge Details
How to create basic alerts in Grafana for Skyline Technical Level
Solution
To create a new basic alert in the CP Dashboard - Overview & Alerts for a specific metric, do these steps:
  1. Create a new graph that shows the required metric in the CP Dashboard - Overview & Alerts.

    Note
    : If the desired metric already has a graph in the CP Dashboard - Overview & Alerts, skip this step and go to step # 2.

    1. Go to CP Dashboard -  Overview & Alerts.



    2. Add a new panel to the dashboard.





    3. Define a query to get the metric. For example: avg by (environment, host_name)(100-system_cpu_utilization{state="idle"}).

      (Click on the image to enlarge it.)



    4. Add a title and description.



    5. Click apply.

  2. Create a new basic threshold alert for the newly added graph. In this example, we create a threshold-based alert for the last 5 minutes.

    1. Select the newly created panel and click Edit.



    2. Click on the Alert tab.



    3. Click on Create alert rule from this panel (if prompted, save the dashboard at this point).



    4. Define the Rule name.



    5. Create a folder for the alerts, or select an existing folder.



    6. Here we create a 3-tier query structure, where Query A -> Query B -> Query C.
      1. Query A - created automatically. This is the panel's query.
      2. Query B - Reduces the data from Query A to perform math operations on it:

        1. For the Operation, select Reduce.



        2. Select A as the input.

        3. Select Last as the function.

        4. Keep the Mode as Strict.



      3. Query C - Performs the math operation on Query B. In this scenario, it defines the threshold for the data.

        1. Add a new query. Click on the +Expression button.

        2. Select Math as the Operation.



        3. In the text box below, add:
          $B>60
          At this threshold, the alert is fired when the metric's value exceeds 60.

    7. Define the alert's conditions:

      1. Examine the last expression (Query C) - select C as the Condition.

      2. Select the desired time for the evaluation of the query. In this example, we evaluate every 30 seconds (30s), and for 2 minutes (2m). This means that the alert is fired only if the condition is met (CPU utilization is > 60 percent) in all samples of 2 minutes, at 30-second sampling intervals.



      3. Click Preview Alerts to make sure that your new alert works as expected.

    8. Click the Save and Exit button (top-right).

    9. Monitor your alert in the Alerts Panel.
    This solution has been verified for the specific scenario, described by the combination of Product, Version and Symptoms. It may not work in other scenarios.

    Give us Feedback
    Please rate this document
    [1=Worst,5=Best]
    Comment