# Configuring Yandex Monium alerts for Yandex Cloud Backup resources

An _alert_ is a sequence of named [queries](../../monium/concepts/data-model.md#queries) calculated once a minute. The resulting query value is compared to the preset threshold values. If a threshold is reached, Monium changes the alert [status](../../monium/concepts/alerting/alert.md#alert-statuses) to `Alarm` or `Warning` and notifies the user via a [notification channel](../../monium/concepts/alerting/notification-channel.md).

You can [configure](../../monium/operations/alert/create-alert.md) an alert for any of the [Yandex Cloud Backup](../index.md) metrics. We recommend creating alerts for the following events:

* A new [Cloud Backup agent](../concepts/agent.md) version is out.
* Cloud Backup agent unavailable.
* Backup operation failed.

{% note info %}

If a metric has never come to Monium before, the system will not be able to suggest this metric in the pop-up menu of the query builder. In which case enter your query in code mode in the [query language](../../monium/concepts/querying.md).

{% endnote %}


### Available agent versions {#version-available}

To create an alert to get notified about available agent versions:

{% list tabs group=instructions %}

- Management console {#console}

  1. On the [Monium](https://monium.yandex.cloud) home page, select **Alerts** on the left.
  1. At the top right, click **Create alert** → **Custom**.
  1. In the **Name** field, specify `agent_available_new_version`.
  1. Under **Alert configuration**:
      1. Click ![image](../../_assets/console-icons/code.svg) to enable code mode.
      1. Enter a query in the query language:

          ```text
          {project = "folder__<folder_ID>", service = "__backup__", cluster = "default", resource_type = "agent", name = "agent_version_available", resource_name = "<VM_name>"}
          ```

          Where:

          * `project`: ID of the folder the VM is in. You can [copy](../../resource-manager/operations/folder/get-id.md) the folder ID on the top panel in the management console.
          * `service`: Service name.
          * `cluster`: Environment.
          * `resource_type`: Resource type.
          * `name`: Metric name.
          * `resource_name`: VM name. To select all VMs, specify `"*"` instead of the VM name.

  1. Under **Alert conditions**, specify:
      * **Comparison function**: `Not equals to`.
      * **Warning**: Delete the value.
      * **Alarm**: `0`.

  1. Under **Notifications**, add the notification channels of interest.
  1. Click **Create alert**.

{% endlist %}


### Agent unavailable {#agent-offline}

To create an alert get notified if the agent is unavailable:

{% list tabs group=instructions %}

- Management console {#console}

  1. On the [Monium](https://monium.yandex.cloud) home page, select **Alerts** on the left.
  1. At the top right, click **Create alert** → **Custom**.
  1. In the **Name** field, specify `agent_status_offline`.
  1. Under **Alert configuration**:
      1. Click ![image](../../_assets/console-icons/code.svg) to enable code mode.
      1. Enter a query in the query language:

          ```text
          {project = "folder__<folder_ID>", service = "__backup__", cluster = "default", resource_type = "agent", name = "agent_alive", resource_name = "<VM_name>"}
          ```

          Where:

          * `project`: ID of the folder the VM is in. You can [copy](../../resource-manager/operations/folder/get-id.md) the folder ID on the top panel in the management console.
          * `service`: Service name.
          * `cluster`: Environment.
          * `resource_type`: Resource type.
          * `name`: Metric name.
          * `resource_name`: VM name. To select all VMs, specify `"*"` instead of the VM name.

  1. Under **Alert conditions**, specify:
      * **Comparison function**: `Equals to`.
      * **Warning**: Delete the value.
      * **Alarm**: `0`.

  1. Under **Notifications**, add the notification channels of interest.
  1. Click **Create alert**.

{% endlist %}


### Backup operation failed {#operation-failure}

To create an alert get notified about failed backup operations:

{% list tabs group=instructions %}

- Management console {#console}

  1. On the [Monium](https://monium.yandex.cloud) home page, select **Alerts** on the left.
  1. At the top right, click **Create alert** → **Custom**.
  1. In the **Name** field, specify `agent_operation_failure`.
  1. Under **Alert configuration**:
      1. Click ![image](../../_assets/console-icons/code.svg) to enable code mode.
      1. Enter a query in the query language:

          ```text
          {project = "folder__<folder_ID>", service = "__backup__", cluster = "default", resource_type = "agent", name = "BackupError", action = "CompleteFailed", resource_name = "<VM_name>"}
          ```

          Where:

          * `project`: ID of the folder the VM is in. You can [copy](../../resource-manager/operations/folder/get-id.md) the folder ID on the top panel in the management console.
          * `service`: Service name.
          * `cluster`: Environment.
          * `resource_type`: Resource type.
          * `name`: Metric name.
          * `action`: Action type.
          * `resource_name`: VM name. To select all VMs, specify `"*"` instead of the VM name.

  1. Under **Alert conditions**, specify:
      * **Comparison function**: `Greater than`.
      * **Warning**: Delete the value.
      * **Alarm**: `0`.

  1. Under **Notifications**, add the notification channels of interest.
  1. Click **Create alert**.

{% endlist %}


#### See also {#see-also}

* [Viewing backup statistics](get-stats.md)
* [Yandex Monitoring metric reference](../metrics.md)