> For the complete documentation index, see [llms.txt](https://archive-vn.docs.klaytn.foundation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://archive-vn.docs.klaytn.foundation/content/installation-guide/deployment/core-cell/monitoring-setup.md).

# Giám sát thiết lập

## Tổng quan <a href="#overview" id="overview"></a>

Đội ngũ Klaytn cung cấp một trang web để theo dõi CCN Klaytn tại <http://cypress.klaytn.net:3000>. Tác nhân giám sát `telegraf` được cài đặt trong mỗi CN/PN của CC để thu thập số liệu và gửi chúng đến máy chủ giám sát. Sau khi cài đặt, bạn có thể truy cập trang web giám sát để xem số liệu của CC Klaytn.

Quá trình cài đặt như sau:

1. Cài đặt `telegraf` trong CN/PN
2. Định cấu hình `telegraf`
3. Bắt đầu `telegraf`

## Cài đặt Telegraf <a href="#telegraf-installation" id="telegraf-installation"></a>

Hướng dẫn cài đặt Telegraf (Người dùng Amazon Linux 2, xem bên dưới): <https://docs.influxdata.com/telegraf/latest/introduction/installation/>

**Lưu ý cho Amazon Linux 2**

Để cài đặt Telegraph trên Amazon Linux 2, bạn có thể sử dụng kho lưu trữ yum của InfluxData như sau:

```
cat <<EOF | sudo tee /etc/yum.repos.d/influxdb.repo
[influxdb]
name = InfluxDB Repository - RHEL 7
baseurl = https://repos.influxdata.com/rhel/7/\$basearch/stable
enabled = 1
gpgcheck = 1
gpgkey = https://repos.influxdata.com/influxdb.key
EOF
```

## Thiết lập Telegraf <a href="#telegraf-setup" id="telegraf-setup"></a>

### Kích hoạt giám sát trong kcnd/kpnd <a href="#enable-monitoring-in-kcnd-kpnd" id="enable-monitoring-in-kcnd-kpnd"></a>

/etc/kcnd/conf/kcnd.conf

```
...
METRICS=1
PROMETHEUS=1
...
```

**Kiểm tra**

Bạn có thể xác nhận rằng hai tùy chọn trên đã được kích hoạt bằng cách kiểm tra xem cổng 61001 có đang mở hay không.

```
$ netstat -ntap | grep 61001
tcp        0      0 :::61001        :::*       LISTEN      8989/kcn
```

**Định cấu hình dịch vụ Telegraf**

Sao chép tập tin sau vào thư mục cấu hình `telegraf` (`/etc/telegraf/telegraf.d/`) và chỉnh sửa `nodetype`, `instance` và `hostname` cho phù hợp với từng nút:

```
[global_tags]
  # Change "cn" to "pn" for PN installation
  nodetype = "cn"

  # The CN/PN name (e.g. `example-cn`, `example-pn`)
  instance = "<hostname>"

[agent]
  # The CN/PN name (e.g. `example-cn`, `example-pn`)
  hostname = "<hostname>"

[[outputs.influxdb]]
  urls = [ "http://localhost:" ]
  database = "klaytn_cypress"

[[inputs.prometheus]]
  urls = [ "http://localhost:61001/metrics" ]
```

Thay đổi như sau trong `/etc/telegraf/telegraf.conf`:

* Loại bỏ phần `[[outputs.influxdb]]` bằng ghi chú

**Bắt đầu Telegraf**

```
$ systemctl restart telegraf
```

## Grafana <a href="#grafana" id="grafana"></a>

Nếu mỗi CN/PN có cấu hình và tác nhân ở trên, bạn có thể kiểm tra các thông số tại URL sau:

<http://cypress.klaytn.net:3000>

Là người vận hành CC, bạn có thể yêu cầu một tài khoản bằng cách cung cấp tên công ty và địa chỉ email của bạn trong kênh Slack. Xin lưu ý rằng chỉ các người vận hành CC mới được phép yêu cầu tài khoản Grafana.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://archive-vn.docs.klaytn.foundation/content/installation-guide/deployment/core-cell/monitoring-setup.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
