Skip to content

prometheus

``` bash= wget https://github.com/prometheus/prometheus/releases/download/v2.45.0/prometheus-2.45.0.linux-amd64.tar.gz wget https://github.com/prometheus-community/ipmi_exporter/releases/download/v1.6.1/ipmi_exporter-1.6.1.linux-amd64.tar.gz tar zxvf prometheus-2.45.0.linux-amd64.tar.gz tar zxvf ipmi_exporter-1.6.1.linux-amd64.tar.gz ./prometheus --config.file=prometheus.yml

prometheus.yml
``` yml=
# 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'.

    static_configs:
      - targets: ["localhost:9090"]
  - job_name: "ipmi"
    scrape_interval: 10s
    scrape_timeout: 5s
    metrics_path: /metrics
    scheme: http
    static_configs:
    - targets:
      - 167.22.10.1:9290
      labels:
        rack: 'r1'
    - targets:
      - 167.22.1.99:9290
      labels:
        rack: 'r3'

http://172.17.30.109:9090/metrics http://172.17.30.109:9290/metrics http://172.17.30.109:9090/api/v1/query?query=ipmi_dcmi_power_consumption_watts[10m] http://172.17.30.109:9090/api/v1/query?query=ipmi_temperature_celsius{name=~%22.*%20Temp%22}[1m] http://172.17.30.109:9090/api/v1/query?query=sum%20by(rack)%20(ipmi_dcmi_power_consumption_watts)