Prometheus 采集vCenter7监控数据

Posted CIAS

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Prometheus 采集vCenter7监控数据相关的知识,希望对你有一定的参考价值。

 

前提要求

创建vmware_exporter目录 

mkdir -p /vmware_exporter

 创建基于docker部署vmware_exporter脚本

  •  VSPHERE_HOST: "vCenter 管理地址"
  •  VSPHERE_IGNORE_SSL: "True"
  •  VSPHERE_USER: "administrator@vsphere.local"
  •  VSPHERE_PASSWORD: "密码" 
vim /vmware_exporter/docker-compose.yml
version: '3'
services:
  vmware-exporter:
    image: pryorda/vmware_exporter:v0.11.1
    container_name: vmware-exporter
    hostname: vmware-exporter
    restart: always
    ports:
       - '9272:9272'
    expose:
       - 9272
    environment:
      VSPHERE_HOST: "You_vCenter"
      VSPHERE_IGNORE_SSL: "True"
      VSPHERE_USER: "administrator@vsphere.local"
      VSPHERE_PASSWORD: "YOU_password"
    labels:
      org.label-schema.group: "monitoring"

 运行vmware_exporter容器

docker-compose up -d

vmware_exporter采集结果查看,部分展示 

Prometheus 配置

  • static_configs 此处vCenter 管理地址
  • replacement此处是vmware_exporter采集数据地址
scrape_configs:
  - job_name: 'web' 
    scrape_interval: 5s
    static_configs: 
      - targets: 
        - localhost:9090

  - job_name: 'vmware_vcenter'
    metrics_path: '/metrics'
    static_configs:
      - targets:
        - YOU_vCenter_IP
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: YOU_vmware_vcenter_IP:9272

Grafana 图形展示

以上是关于Prometheus 采集vCenter7监控数据的主要内容,如果未能解决你的问题,请参考以下文章

Prometheus 采集vCenter7监控数据

Prometheus 采集Windows主机监控数据

Prometheus 采集rabbitmq监控数据

Prometheus 采集rabbitmq监控数据

Prometheus 采集snmp监控数据

Prometheus 采集Mysql监控数据