To create a new basic alert in the
CP Dashboard - Overview & Alerts for a specific metric, do these steps:
- 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.
- Go to CP Dashboard - Overview & Alerts.

- Add a new panel to the dashboard.


- 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.)
- Add a title and description.

- Click apply.
- 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.
- Select the newly created panel and click Edit.

- Click on the Alert tab.

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

- Define the Rule name.

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

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

- Select A as the input.
- Select Last as the function.
- Keep the Mode as Strict.

- Query C - Performs the math operation on Query B. In this scenario, it defines the threshold for the data.
- Add a new query. Click on the +Expression button.
- Select Math as the Operation.

- In the text box below, add:
$B>60
At this threshold, the alert is fired when the metric's value exceeds 60.
- Define the alert's conditions:
- Examine the last expression (Query C) - select C as the Condition.
- 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.

- Click Preview Alerts to make sure that your new alert works as expected.
- Click the Save and Exit button (top-right).
- 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.
|