Open miavi opened 7 months ago
Hi miavi,
You can access second host with URL http://YOUR_IP:9275/metrics?section=cpd2
My configuration file is as follows, and it works fine. ( Thank you mbrother2, for pointing out the key point. )
vmware_exporter config.yml
default:
vsphere_host: "192.168.1.4"
vsphere_user: "ADMIN@vsphere.local"
vsphere_password: "PASSWORD"
ignore_ssl: True
specs_size: 2000
fetch_custom_attributes: True
fetch_tags: True
fetch_alarms: True
collect_only:
vms: True
vmguests: True
datastores: True
hosts: True
snapshots: True
vc02:
vsphere_host: "192.168.2.2"
vsphere_user: "ADMIN@vsphere.local"
vsphere_password: "PASSWORD"
ignore_ssl: True
specs_size: 2000
fetch_custom_attributes: True
fetch_tags: True
fetch_alarms: True
collect_only:
vms: True
vmguests: True
datastores: True
hosts: True
snapshots: True
prometheus.yml
- job_name: 'vmware_exporter'
scrape_interval: 1m
scrape_timeout: 1m
metrics_path: '/metrics'
static_configs:
- targets:
- '192.168.1.4'
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: 127.0.0.1:9272
- job_name: 'vc02'
static_configs:
- targets:
- '127.0.0.1:9272'
params:
section: ['vc02']
Thank you both very much for the information, I will try this configuration
Hi good day to all.
I currently have 1 docker container (https://hub.docker.com/r/pryorda/vmware_exporter) configured for 2 vsphere instances
The problem I have is that the data is interleaved when the 2 instances are active in the Prometheus job (with only 1 instance this problem does not exist)
this is the configuration
docker-compose.yaml
config.yml
prometheus job
When I perform a query with Prometheus, for example "vmware_host_hardware_info" it shows me in the x.x.x.x instance the hostname of y.y.y.y and vice versa, it is as if the metrics were mixed
On the other hand, if I set up two independent containers (on a different port), each container pointing to 1 vsphere host and then 2 different jobs in Prometheus, this problem does not occur.
Even when the config.yml only has a "default" section and is not multi-room, it works correctly and does not mix the data
It could be a bug when configuring a .yml file with vsphere multistay
In advanced very thanks