기본 설정에 필요한 부분만 수정하였습니다.

각자 설치 시 재 설정 파일과 비교하시면 좋을 것아요.

# my global config
global:
  scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
  # scrape_timeout is set to the global default (10s).

# Alertmanager configuration
alerting:
  alertmanagers:
    - static_configs:
        - targets:
          # - alertmanager:9093

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
  # - "first_rules.yml"
  # - "second_rules.yml"

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
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'.

    scrape_interval: 5m
    scrape_timeout: 1m

    static_configs:
      - targets: ["localhost:9090"]

  - job_name: 'snmp'
    static_configs:
      - targets: ['192.168.10.2']  # SNMP device.
      - targets: ['192.168.10.3']  # SNMP device.
      - targets: ['192.168.10.4']  # SNMP device.
      - targets: ['192.168.10.5']  # SNMP device.
    metrics_path: /snmp
    params:
      module: [if_mib]
      community: [<각자 설정한 commuity  값>]
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: 192.168.0.17:9116  # The SNMP exporter's real hostname:port.
  - job_name: 'grafana_metrics'
    scrape_interval: 15s
    scrape_timeout: 5s

    static_configs:
      - targets: ['192.168.0.17:3000']

'기술 노트 > prometheus' 카테고리의 다른 글

prometheus와 snmp_exporter 설치 결과  (0) 2023.04.04
Prometheus 설치 및 실행  (0) 2023.03.21

+ Recent posts