Monitoring VMware using Zabbix
Zabbix has native support for VMware by integrating with vCenter API. Zabbix does not require any 3rd party plugins, templates, or modules. Zabbix can monitor vCenter resources, data stores, networks, auto discover ESXi hosts and guest VMs.
Complete the base server setup as outlined in zabbix-docker and then follow the below steps for VMware integration and monitoring.
Requirements
- vSphere server with multiple ESXi hosts registered
- Guest VMs with
VMware Toolsinstalled - Recommended that all guest VMs have FQDN names
- vSphere user named
zabbixwith read-only permissions on all objects
Zabbix Docker Compose
- By default, the Zabbix docker image does not start any VMware collectors. In the
docker-composezabbix-serverenvironment section addZBX_STARTVMWARECOLLECTORS: 3to start the VMware collector. - Note that you need 2 x the number of collectors for every vSphere instance you want to monitor.
- Run
docker-compose down; docker-compose up -dto restart Zabbix and enable the VMware collectors.
# Zabbix Server Docker Compose
zabbix-server:
...
environment:
...
ZBX_STARTVMWARECOLLECTORS: 3Zabbix Configuration
- Create a new host for the vSphere
- In the template section, use the
VMware FQDNand set the following macros - If VMware guests are not using FQDN hostnames, then use the
VMwaretemplate and Zabbix will used UUIDs for hostnames. This is ugly and not preferred.
| Name | Value | Description |
|---|---|---|
{$VMWARE.URL} |
https://vsphere.example.internal/sdk | VMware service (vCenter or ESXi hypervisor) SDK URL (https://servername/sdk) |
{$VMWARE.USERNAME} |
zabbix@vsphere.local | VMware service user name |
{$VMWARE.PASSWORD} |
supersecret | VMware service {$VMWARE.USERNAME} user password |
Automatically Adding Discovered Hosts to Inventory
Navigate to:
- Data Collection / Templates / Select VMware FQDN template / Discovery Rules
Auto adding VMware ESXi Hosts:
- Discover VMware hypervisor / Host Prototypes / {#HVNAME} / Inventory / Select Automatic / Click Update
Auto adding VMware ESXi Guests:
- Discover VMware VMs FQDN / Host Prototypes / {#VMNAME} / Inventory / Select Automatic / Click Update
Notes
- Zabbix will auto discover EXSi hosts and all guest VMs. Do not add them manually to Zabbix.
- The default poll time is 1 hour, so be patient!
- You can always open the foo tab and click the
Execute Nowbutton. - To validate, ensure the vSphere version data is populated. The other items will be populated within 1 hour.