root@dlp:~ # vi /usr/local/etc/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"
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
scheme: https
tls_config:
cert_file: /usr/local/etc/server.crt
key_file: /usr/local/etc/server.key
insecure_skip_verify: true
basic_auth:
username: 'admin'
password: 'password'
static_configs:
- targets: ["localhost:9090"]
- job_name: node
# targets にホストを追加
static_configs:
- targets: ['localhost:9100', 'node01.srv.world:9100']
# または グループを分けたい場合は上例ではなく
# 以下のように [job_name] セクションを追加して設定する
# [job_name] は任意の名前
- job_name: Hiroshima
static_configs:
- targets: ['node01.srv.world:9100']
root@dlp:~ # service prometheus restart
|