# Cảnh Báo Giám Sát HI GIO - Kênh Thông Báo qua Telegram

## <mark style="color:green;">**Tổng quan**</mark> <a href="#introduction" id="introduction"></a>

Chức năng này cho phép người dùng tạo các quy tắc nhận thông báo qua kênh Telegram khi trạng thái của các VM vượt quá hoặc giảm xuống dưới các ngưỡng cụ thể.

## <mark style="color:green;">Quy trình</mark> <a href="#id-2.-guidance" id="id-2.-guidance"></a>

{% tabs %}
{% tab title="I. Cách lấy BOT API TOKEN và Chat ID của Telegrambot" %}

#### Hãy xem đường dẫn này để tìm hiểu cách lấy [BOT API TOKEN](https://gist.github.com/nafiesl/4ad622f344cd1dc3bb1ecbe468ff9f8a#create-a-telegram-bot-and-get-a-bot-token) và [Chat ID](https://stackoverflow.com/questions/32423837/telegram-bot-how-to-get-a-group-chat-id) <a href="#i.-how-to-get-bot-api-token-and-chat-id-of-telegram" id="i.-how-to-get-bot-api-token-and-chat-id-of-telegram"></a>

{% endtab %}

{% tab title="II. Tạo Điểm Đến Cảnh Báo sử dụng kênh thông báo Telegram" %}
**Bước 1:** Đăng nhập vào **HI GIO cloud** > **Monitor**.

**Bước 2:** Chọn **Manage**, và chọn **NEW** dưới phần **Alert Contact Destination**.

<figure><img src="https://content.gitbook.com/content/dOZ82gj0wvhbAUlxBHpj/blobs/S6Ro01FKc3bTQPwoiyVW/image.png" alt=""><figcaption></figcaption></figure>

* Cửa sổ **Alert Contact Destination** mới sẽ mở ra.

* Chọn **Integration** là **Telegram**.

  <figure><img src="https://content.gitbook.com/content/dOZ82gj0wvhbAUlxBHpj/blobs/mdhOxMDm5Eoq7kEnJm2m/image.png" alt=""><figcaption></figcaption></figure>

* Điền thông tin liên lạc vào cửa sổ này > **SAVE**.

  <figure><img src="https://content.gitbook.com/content/dOZ82gj0wvhbAUlxBHpj/blobs/X8QUz815cp5LCzCPWaWC/image.png" alt=""><figcaption></figcaption></figure>

* Thông tin **BOT API Token** sẽ bị ẩn trong biểu mẫu chỉnh sửa.<br>

  <figure><img src="https://content.gitbook.com/content/dOZ82gj0wvhbAUlxBHpj/blobs/fqtq4erhZ1Vcm9lUeP5a/image.png" alt=""><figcaption></figcaption></figure>

**Giải thích các trường:**

*<mark style="color:blue;">**Name:**</mark>* <mark style="color:blue;"></mark><mark style="color:blue;">Tên của điểm đến cảnh báo.</mark>

*<mark style="color:blue;">**Integration:**</mark>* <mark style="color:blue;"></mark><mark style="color:blue;">Kênh mà người dùng có thể nhận thông báo. Trong phiên bản này, có 3 kênh có sẵn:</mark> <mark style="color:blue;"></mark><mark style="color:blue;">**Email**</mark> <mark style="color:blue;"></mark><mark style="color:blue;">và</mark> <mark style="color:blue;"></mark><mark style="color:blue;">**Telegram**</mark><mark style="color:blue;">.</mark>

*<mark style="color:blue;">**BOT API Token:**</mark>* <mark style="color:blue;"></mark><mark style="color:blue;">Token để truy cập BOT API.</mark>

*<mark style="color:blue;">**Chat ID:**</mark>* <mark style="color:blue;"></mark><mark style="color:blue;">ID của Group Chat trên Telegram.</mark>

<mark style="color:blue;">Tùy Chọn</mark> <mark style="color:blue;"></mark>*<mark style="color:blue;">**Webhook Settings:**</mark>*

*<mark style="color:blue;">+ Disable Web Page Preview:</mark>* <mark style="color:blue;"></mark><mark style="color:blue;">Nếu tùy chọn này được chọn, phần xem trước trang web sẽ bị ẩn trong nội dung thông báo.</mark>

*<mark style="color:blue;">+ Disable resolve message:</mark>* <mark style="color:blue;"></mark><mark style="color:blue;">Thông báo "resolved" sẽ không được gửi nếu tùy chọn này được chọn.</mark>

* Sau khi hoàn thành, **Alert Contact Destination** sẽ hiển thị như sau:

<figure><img src="https://content.gitbook.com/content/dOZ82gj0wvhbAUlxBHpj/blobs/SzCvaBgN9MO8qu6ftoVZ/image.png" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="III. Tạo Quy Tắc Cảnh Báo sử dụng kênh thông báo Telegram" %}
**Bước 1**: Đăng nhập vào **HI GIO cloud** > **Monitor**.

**Bước 2:** Chọn **Manage**, và chọn **NEW** dưới phần **Alert Rules**.

<figure><img src="https://content.gitbook.com/content/dOZ82gj0wvhbAUlxBHpj/blobs/gCPQ7doeY3l0ECQerpJE/image.png" alt=""><figcaption></figcaption></figure>

* Cửa sổ **Alert Rule mới** sẽ mở ra.
* Điền thông tin vào cửa sổ này và chọn **Alert Contact Destination** sử dụng kênh thông báo Telegram > **SAVE**.

<figure><img src="https://content.gitbook.com/content/dOZ82gj0wvhbAUlxBHpj/blobs/Nw6TpUytJqXo1YcCSTPC/image.png" alt=""><figcaption></figcaption></figure>

* Sau khi hoàn thành, **Alert Rule** sẽ hiển thị như sau:

<figure><img src="https://content.gitbook.com/content/dOZ82gj0wvhbAUlxBHpj/blobs/X5tTWrxU3SSzpKejwTZ1/image.png" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="IV. Thông Báo Qua Telegram" %}
Bất cứ khi nào ngưỡng được định nghĩa trong quy tắc cảnh báo được đạt tới, bạn sẽ nhận được thông báo Telegram cho biết các **Firing Instances** hoặc **Resolved Instances**.

* Ví dụ Telegram – Firing Instance

<figure><img src="https://content.gitbook.com/content/dOZ82gj0wvhbAUlxBHpj/blobs/OG3gl9BbHwvAhGHlWg9K/image.png" alt=""><figcaption></figcaption></figure>

* Ví dụ Telegram – Resolved Instance

<figure><img src="https://content.gitbook.com/content/dOZ82gj0wvhbAUlxBHpj/blobs/4NZaXsTRnyYCbgpTWoxG/image.png" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}
