---
title: "Manage availability checks"
sidebar_label: "Manage availability checks"
sidebar_position: 4
description: "How to modify, create, and delete an availability check"
---

import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import {TabItemLabel} from '@selectel/docux/components'
import MoreVerticalIcon from '@selectel/docux/icons/more-vertical'
import CheckIcon from '@selectel/docux/icons/check'
import EditIcon from '@selectel/docux/icons/edit'
import Formbricks from '@theme/MDXComponents/Formbricks'

# Manage availability checks

A [target group](/cloud-servers/load-balancers/about-load-balancers.mdx#target-groups) can have only one [availability check](/cloud-servers/load-balancers/about-load-balancers.mdx#availability-checks).

You can [change](#change-availability-check) all parameters of an availability check, except for the check type. If you need to change the check type, you can [delete the existing availability check](#delete-availability-check) and [create a new one](#create-availability-check) with the required type using the OpenStack CLI.

## Create an availability check \{#create-availability-check}

<Tabs queryString="create-availability-check">
  <TabItem value="openstack">
    <TabItemLabel>
      OpenStack CLI
    </TabItemLabel>

    1. [Open the OpenStack CLI](/cloud-servers/tools/openstack-cli/).

    2. Create an availability check:

       ```bash
       openstack loadbalancer healthmonitor create \
         --name <name> \
         --delay <delay> \
         --timeout <timeout> \
         --max-retries <max_retries> \
         --max-retries-down <max_retries_down> \
         --type <type> \
         --http-method <http_method> \
         --url-path <url_path> \
         --expected-codes <codes> \
         <pool>
       ```

       Specify:

       * `<delay>` — interval between checks in seconds;
       * `<timeout>` — response wait time in seconds;
       * `<max_retries>` — number of consecutive successful connections after which the server is set to operational;
       * `<max_retries_down>` — number of consecutive failed connections after which server operation is suspended;
       * `<type>` — check type depending on the target group protocol:

         * TCP group — `TCP`, `PING`;
         * PROXY group — `TLS_HELLO`, `HTTP`, `TCP`, `PING`;
         * UDP group — `UDP_CONNECT`, `PING`;
         * HTTP group — `HTTP`, `TCP`, `PING`;
       * HTTP request parameters if you selected the `HTTP` check type:

         * `--http-method <http_method>` — check method: `GET`, `POST`, `DELETE`, `PUT`, `HEAD`, `OPTIONS`, `PATCH`, `CONNECT`, `TRACE`;
         * `--url-path <url_path>` — request path without the domain name;
         * `--expected-codes <codes>` — expected response codes separated by commas;
       * `<pool>` — target group ID or name; you can find it using the `openstack loadbalancer pool list` command.
  </TabItem>
</Tabs>

## Modify an availability check \{#change-availability-check}

<Tabs queryString="change-availability-check">
  <TabItem value="panel" default>
    <TabItemLabel>
      Control panel
    </TabItemLabel>

    1. In the [Control panel](https://my.selectel.ru/vpc/default/lbaas/load-balancers/), on the top menu, click **Products** and select **Cloud Servers**.
    2. Go to the **Load Balancers** section → **Target Groups** tab.
    3. Open the target group page.
    4. Ensure the **Availability checks** toggle is turned on.
    5. If the check type is HTTP, you can change the URL access and expected response codes; to do this, click **Edit** and enter the new settings.
    6. Optional: open the **Advanced Rule Settings** block and specify [connection settings](/cloud-servers/load-balancers/about-load-balancers.mdx#connection-settings):

       * for incoming requests to the load balancer — specify the connection timeout and connection limit;
       * for requests from the load balancer to the servers — specify the connection timeout, inactivity timeout, and TCP packet wait timeout.
    7. Click **Save**.
  </TabItem>

  <TabItem value="openstack">
    <TabItemLabel>
      OpenStack CLI
    </TabItemLabel>

    1. [Open the OpenStack CLI](/cloud-servers/tools/openstack-cli/).
    2. Modify the check parameters. The check type cannot be changed:

       ```bash
       openstack loadbalancer healthmonitor set \
         --delay <delay> \
         --timeout <timeout> \
         --max-retries <max_retries> \
         --max-retries-down <max_retries_down> \
         --http-method <http_method> \
         --url-path <url_path> \
         --expected-codes <codes> \
         <health_monitor>
       ```

       Specify:

       * `<delay>` — interval between checks in seconds;
       * `<timeout>` — response wait time in seconds;
       * `<max_retries>` — number of consecutive successful connections after which the server is set to operational;
       * `<max_retries_down>` — number of consecutive failed connections after which server operation is suspended;
       * HTTP request parameters if the check type is `HTTP`:

         * `--http-method <http_method>` — check method: `GET`, `POST`, `DELETE`, `PUT`, `HEAD`, `OPTIONS`, `PATCH`, `CONNECT`, `TRACE`;
         * `--url-path <url_path>` — request path without the domain name;
         * `--expected-codes <codes>` — expected response codes separated by commas;
       * `<health_monitor>` — availability check ID or name; you can find it using the `openstack loadbalancer healthmonitor list`` command`.
  </TabItem>
</Tabs>

## Delete an availability check \{#delete-availability-check}

:::warning

If you delete an availability check, the load balancer will route traffic to all servers in the target group, including unavailable ones.

:::

<Tabs queryString="delete-availability-check">
  <TabItem value="openstack">
    <TabItemLabel>
      OpenStack CLI
    </TabItemLabel>

    1. [Open the OpenStack CLI](/cloud-servers/tools/openstack-cli/).

    2. Delete the check:

       ```bash
       openstack loadbalancer healthmonitor delete <health_monitor>
       ```

       Specify `<health_monitor>` — availability check ID or name; you can find it using the `openstack loadbalancer healthmonitor list`` command`.
  </TabItem>
</Tabs>

<Formbricks />
