2
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Blackbox Exporter で死活監視

Last updated at Posted at 2019-11-10

Prometheus/GrafanaでCatalystのトラフィックを収集してみる」の続きで、死活監視をします。

参考にしたのは、「PrometheusとBlackbox Exporterでサーバ死活監視」です。

docker-compose.ymlにblackbox-exporterを追加します。

docker-compose.yml
  blackbox_exporter:
    image: prom/blackbox-exporter:latest
    volumes:
      - ./blackbox_exporter/config.yml:/etc/blackbox_exporter/config.yml

blackbox-exportの設定ファイルはconfig.yml
死活監視のみなので、icmpだけ記述します。

config.yml
modules:
  icmp:
    prober: icmp

prometheus.ymlにも以下の如く追記します。

prometheus.yml
  - job_name: 'blackbox_icmp'
    scrape_interval: 10s
    metrics_path: /probe
    params:
      module: [icmp]
    static_configs:
      - targets:
        - '192.168.0.110'
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: blackbox_exporter:9115

動かすとこんな感じです。
1がup、0がdown。
スクリーンショット 2019-11-11 0.06.13.png

次はAlartManagerか。
以上。

2
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?