---
title: >-
  Create cluster alerts to notify when a percentage of groups are in critical
  state
description: >-
  Learn to create cluster alerts that notify when a percentage of groups meet
  conditions, like alerting when 40% of hosts have high CPU usage.
breadcrumbs: >-
  Docs > Monitors > Monitor Guides > Create cluster alerts to notify when a
  percentage of groups are in critical state
---

# Create cluster alerts to notify when a percentage of groups are in critical state

## Overview{% #overview %}

This guide shows how to create alerts that would not notify for each single group meeting the condition, but only when a given percent of them do. This is helpful, for example, if you want a monitor that alerts only when a given percentage of hosts or containers reach a critical state.

### Example: Alert for a percentage of hosts with high CPU usage{% #example-alert-for-a-percentage-of-hosts-with-high-cpu-usage %}

In this example, you want to receive a notification when 40 percent of hosts have a CPU usage above 50 percent. Leverage the `min_cutoff` and `count_nonzero` functions:

- Use the `min_cutoff` function to count the number of hosts that have CPU usage above 50 percent.
- Use the `count_nonzero` function to count the total number of hosts.
- Divide one by the other for the resulting percentage of hosts with CPU usage above 50 percent.
- Then, set the condition to alert if the percentage of hosts in that condition reaches 40 percent.

{% image
   source="https://docs.dd-static.net/images/monitors/guide/create_cluster_alert/cluster_alert_config.6a4fdd557a63ccf048227bb17d3b24cb.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/monitors/guide/create_cluster_alert/cluster_alert_config.6a4fdd557a63ccf048227bb17d3b24cb.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="Monitor configuration for cluster alert to receive a notification when 40 percent of hosts have a CPU usage above 50 percent" /%}

This monitor tracks the percentage of host that have a CPU usage above 50 percent within the last ten minutes and generates a notification if more than 40 percent of those hosts meet the specified condition.

## Further Reading{% #further-reading %}

- [Learn how to create a monitor](https://docs.datadoghq.com/monitors/)
- [Configure your monitor notifications](https://docs.datadoghq.com/monitors/notify/)
