Prometheus : 監視対象ノードを追加する (Windows)2025/09/26 |
|
Windows コンピューターを監視対象ノードとして追加したい場合は以下のように設定します。 |
|
| [1] |
対象の Windows コンピューターに [Windows exporter] をインストールします。 ⇒ https://github.com/prometheus-community/windows_exporter/releases |
| [2] | インストールすると [windows_exporter] が起動し、ポート [9182] をリスンします。 Windows Firewall にも許可ルールが登録されます。 登録されなかった場合は、手動で許可してください。 |
|
|
| [3] | Prometheus サーバー側で設定を追加します。 |
|
root@dlp:~#
vi /etc/prometheus/prometheus.yml
.....
.....
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped
from this config.
- job_name: 'prometheus'
# Override the global default and scrape targets from this job every 5 seconn
ds.
scrape_interval: 5s
scrape_timeout: 5s
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
static_configs:
- targets: ['localhost:9090']
- job_name: node
# If prometheus-node-exporter is installed, grab stats about the local
# machine by default.
# 44行目 : targets に Windows ホストを追加
static_configs:
- targets: ['localhost:9100', 'rx-7.srv.world:9182']
# または グループを分けたい場合は上例ではなく
# 以下のように [job_name] セクションを追加して設定する
# [job_name] は任意の名前
- job_name: Windows
static_configs:
- targets: ['rx-7.srv.world:9182']
root@dlp:~# systemctl restart prometheus
|
| [4] | Prometheus Web UI へアクセスし、[Status] - [Targets] をクリックして、設定したホストが追加されているか確認します。 |
|
|
|
| Sponsored Link |
|
|