> For the complete documentation index, see [llms.txt](https://utm-1.gitbook.io/utm-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://utm-1.gitbook.io/utm-docs/dokumentaciya/utm-it/resheniya/monitoring/prometheus/monitoring-bind.md).

# Мониторинг Bind

## Ссылки

Monitor Bind9 DNS with Prometheus bind\_exporter: [devopslite.com](https://devopslite.com/monitor-bind9-dns-with-prometheus-bind-exporter/)

DNS Monitoring tools: [miembros.lactld.org](https://miembros.lactld.org/wp-content/uploads/2019/09/34-Taller-Comercial-y-Te%CC%81cnico-Mauricio-Vergara-ICANN-DNS-Monitoring-tools.pdf)

## Информация

Для подключения Linux сервера к мониторингу Prometheus необходимо выполнить несколько шагов:

1. На сервер с BIND установить prometheus-bind-exporter
2. В настройках Prometheus подключить target со ссылкой на сервер c BIND который необходимо мониторить

## Установка prometheus-bind-exporter

### Настройка сервера с BIND

На серверах BIND, подключаемых к мониторингу необходимо выполнить следующие действия:

<details>

<summary>Выполнить следующие действия</summary>

Выполнить:

```bash
sudo su

# Создать пользователя под которым будет работать служба bind_exporter
groupadd --system prometheus
grep prometheus /etc/group
useradd -s /sbin/nologin -r -g prometheus prometheus

# Установить prometheus-bind-exporter
apt install prometheus-bind-exporter -y
```

Внести изменения в файл `/etc/bind/named.conf.local`

```bash
nano /etc/bind/named.conf.local
```

В файл добавить следующий фрагмент:

```json
statistics-channels {
  inet 0.0.0.0 port 8053 allow { 127.0.0.1; };
};
```

Выполнить:

```bash
# Перезапустить bind9
service bind9 reload
systemctl restart bind9

# Перезапустить prometheus-bind-exporter
systemctl restart prometheus-bind-exporter
```

Проверка:

* <http://192.168.1.3:9119/metrics>
* <http://192.168.1.4:9119/metrics>

</details>

## Настройка Prometheus

### Регистрация target

В файле `argocd\env-prod\apps\monitoring\prometheus\values.yaml`&#x20;

<details>

<summary>Изменения в файле <code>argocd\env-prod\apps\monitoring\prometheus\values.yaml</code></summary>

Добавить ip сервера в секцию&#x20;

prometheus\prometheusSpec\additionalScrapeConfigs

```yaml
    additionalScrapeConfigs: |
      - job_name: 'bind_exporter'
        scrape_interval: 15s
        metrics_path: '/metrics'
        static_configs:
          - targets:
            - 192.168.1.3:9119
            - 192.168.1.4:9119
            - <ip>:9100
```

Сделать коммит в репозиторий GitHub с обновлением файла `values.yaml`&#x20;

Дождаться, когда Argo CD обновить приложение k8s-prometheus.

</details>

### Настройка оповещений

{% hint style="info" %}
**ПРОРАБОТАТЬ!!!**
{% endhint %}

## Настройка Grafana

### Импорт дашбордов из Argo CD

В файле `argocd\env-prod\apps\monitoring\grafana\values.yaml` добавить

<details>

<summary>Изменения в файле <code>argocd\env-prod\apps\monitoring\grafana\values.yaml</code></summary>

```yaml
dashboardProviders:
  dashboardproviders4.yaml:
    apiVersion: 1
    providers:
    - name: 'bind'
      orgId: 1
      folder: 'Bind'
      type: file
      disableDeletion: false
      editable: true
      options:
        path: /var/lib/grafana/dashboards/bind
        foldersFromFilesStructure: false

dashboards:
  redis: {}
```

Сделать коммит в репозиторий GitHub с обновлением файла `values.yaml`&#x20;

Дождаться, когда Argo CD обновить приложение k8s-grafana.

</details>

#### Дашборды

<details>

<summary>Описание импортируемых дашбордов</summary>

#### Bind9 Exporter DNS

Ссылка: [grafana.com](https://grafana.com/grafana/dashboards/12309-bind9-exporter-dns/)

ID = 12309

<figure><img src="/files/aeVnJuSl1J9zSy1bMR48" alt=""><figcaption></figcaption></figure>

#### Bind9 Full

Ссылка: [grafana.com](https://grafana.com/grafana/dashboards/12172-bind9-full/)

ID = 12172

<figure><img src="/files/malic5Ja9NUBFDh9QGpZ" alt=""><figcaption></figcaption></figure>

</details>

### Ручной импорт дашбордов

В Grafana: Dashboards → Import → вставь ID  → выбери источник Prometheus.

Каталог в дашбордах: `Bind`

#### Дашборды

<details>

<summary>Описание импортируемых дашбордов</summary>

Пока нет

</details>


---

# 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:

```
GET https://utm-1.gitbook.io/utm-docs/dokumentaciya/utm-it/resheniya/monitoring/prometheus/monitoring-bind.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
