Using Prometheus+Grafana+VMware-exporter to monitor VMware EXSi Hosts and VMs

This article introduces a simple method to monitor VMware EXSi and VMs with VMware-exporter, related metrics can be pulled by Prometheus, and visualized by Grafana.

Here we use docker to run 4 containers that compose of the entire environment.

First of all, git clone the project from the URL: VMware-ESXI-Monitoring-Tools: Prometheus / Grafana / VMWare ESXi Metrics for Prometheus

then, you need to download docker: Get Docker | Docker Docs, and install the docker for providing docker environment.

Finally, run the command:

复制代码
SMTP_HELLO=[yourdomain.com] SMTP_TO=[first.last@gmail.com] SMTP_FROM=[prometheus@yourdomain.com] SMTP_SMARTHOST=smtp.gmail.com:587 SMTP_USER=[your_gmail_user@gmail.com] SMTP_PASS=[your_google_app_password]
HOST_IP=[host_ip_running_docker_compose] VSPHERE_HOST=[esxi_host_ip_or_hostname] VSPHERE_USER=[vsphere_user] VSPHERE_PASS=[vsphere_pass] ./start_containers.sh 

If there's no need to use alert function, just remove the SMTP parameters from the command.

That's it!

If you want to get metrics from multiple vCenters, you can modify ./configs/prometheus.yml.tpl to add more jobs, for example,

复制代码
- job_name: 'vmware_vcenter_0'

  ......

  static_configs:

    - targets: 

      - '{{HOST_IP}}:9272'

- job_name: 'vmware_vcenter_1'

  ......

  static_configs:

    - targets: 

      - '{{HOST_IP}}:9273'

Run docker ps to get containers, and docker compose logs to get logs.

If it's too slow to download images, you can configure Aliyun docker image mirror to speed up.

Navigate to 容器镜像服务 to get registry-mirrors

Modify daemon configuration file /etc/docker/daemon.json to use accelerator:

复制代码
sudo mkdir -p /etc/docker 

sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://{{serial number}}.mirror.aliyuncs.com"] } EOF 

sudo systemctl daemon-reload  

sudo systemctl restart docker

After all set. you can get Dashboard template from Grafana Dashboard. Searching the dashboards with filters vmware or exsi and lable of prometheus to get the one you want. Remember to configure the data source first: https://{``{host_ip}}:3000

相关推荐
ElevenS_it1881 天前
Zabbix+Prometheus+云监控告警统一接入实战:用Webhook+事件总线搭建多源告警归一化平台
kubernetes·zabbix·prometheus
成为你的宁宁1 天前
【基于 Docker-compose 部署 Prometheus 监控系统实战教程 】
docker·容器·prometheus
成为你的宁宁1 天前
【Prometheus+Grafana 监控平台二进制安装配置(图文实操详解)】
grafana·prometheus
蜀道山老天师2 天前
实操|Prometheus Pushgateway 部署、推送与数据管理全流程
运维·服务器·云原生·prometheus
蜀道山老天师2 天前
Docker Compose实战案例:一键部署WordPress+Prometheus监控平台
运维·docker·容器·prometheus
川石课堂软件测试2 天前
接口测试常见面试题及答案
python·网络协议·mysql·华为·单元测试·prometheus·harmonyos
海兰3 天前
在 Grafana 中驾驭 ES|QL:Elasticsearch 管道查询实战指南
大数据·elasticsearch·grafana
蜀道山老天师4 天前
从零搭建 Prometheus 监控 MySQL:含二进制安装、授权、exporter 配置全流程
运维·数据库·mysql·adb·云原生·prometheus
蜀道山老天师5 天前
Prometheus监控Hadoop集群(实操完整版,含避坑指南)
大数据·linux·运维·hadoop·云原生·prometheus
虎头金猫5 天前
Beszel 轻量服务器监控:多台服务器状态统一看,搭起来比 Prometheus 省事太多
linux·运维·服务器·分布式·kafka·开源·prometheus