Raja's Exocortex

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

  1. vSphere server with multiple ESXi hosts registered
  2. Guest VMs with VMware Tools installed
  3. Recommended that all guest VMs have FQDN names
  4. vSphere user named zabbix with read-only permissions on all objects

Zabbix Docker Compose

  1. By default, the Zabbix docker image does not start any VMware collectors. In the docker-compose zabbix-server environment section add ZBX_STARTVMWARECOLLECTORS: 3 to start the VMware collector.
  2. Note that you need 2 x the number of collectors for every vSphere instance you want to monitor.
  3. Run docker-compose down; docker-compose up -d to restart Zabbix and enable the VMware collectors.
# Zabbix Server Docker Compose
  zabbix-server:
	...
    environment:
	  ...
      ZBX_STARTVMWARECOLLECTORS: 3

Zabbix Configuration

  1. Create a new host for the vSphere
  2. In the template section, use the VMware FQDN and set the following macros
  3. If VMware guests are not using FQDN hostnames, then use the VMware template 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:

Auto adding VMware ESXi Hosts:

Auto adding VMware ESXi Guests:

Notes

  1. Zabbix will auto discover EXSi hosts and all guest VMs. Do not add them manually to Zabbix.
  2. The default poll time is 1 hour, so be patient!
  3. You can always open the foo tab and click the Execute Now button.
  4. To validate, ensure the vSphere version data is populated. The other items will be populated within 1 hour.

References:

  1. Zabbix VM Monitoring