Support of monitoring VMware environments is available in Zabbix starting with version 2.2.0.
Zabbix can use low-level discovery rules to automatically discover VMware hypervisors and virtual machines and create hosts to monitor them, based on pre-defined host prototypes.
The default dataset in Zabbix offers several ready-to-use templates for monitoring VMware vCenter or ESX hypervisor.
The minimum required VMware vCenter or vSphere version is 5.1.
The virtual machine monitoring is performed in two steps:
vmware collector Zabbix processes gather virtual machine data. The processes obtain necessary information from VMware web services over the SOAP protocol, pre-process it and store in Zabbix server shared memory.
Poller processes retrieve the data using Zabbix simple check VMware keys.
Zabbix divides collected data into two types: VMware configuration data and VMware performance counter data. Both types are collected independently by vmware collectors. It is recommended to enable more collectors than the number of monitored VMware services. Otherwise, the retrieval of VMware performance counter statistics might be delayed by the retrieval of VMware configuration data (which takes a while for large installations).
The following statistics are available based on the VMware performance counter information:
See VMware item keys for the full list of items that obtain data from VMware performance counters.
If Zabbix server is compiled from sources, it should be compiled with the --with-libxml2 and --with-libcurl compilation options to enable virtual machine monitoring. Zabbix packages are compiled with these options enabled.
The following configuration file options can be used to tune the Virtual machine monitoring:
For more details, see the configuration file pages for Zabbix server and proxy.
To support datastore capacity metrics, Zabbix requires VMware configuration parameter vpxd.stats.maxQueryMetrics to be at least 64. See also the VMware knowledge base article.
Zabbix can use a low-level discovery rule (for example, vmware.hv.discovery[{$VMWARE.URL}]) to automatically discover VMware hypervisors and virtual machines. Host prototypes can be created with the low-level discovery rule. When virtual machines are discovered, these prototypes become real hosts. See low-level discovery for more information.
The default dataset in Zabbix offers several ready-to-use templates for monitoring VMware vCenter or directly ESX hypervisor. These templates contain pre-configured LLD rules as well as a number of built-in checks for monitoring virtual installations.
Templates for VMware vCenter and ESX hypervisor monitoring:
In order for the VMware FQDN template to work correctly each monitored VM should have a unique OS name compliant with FQDN rules and VMware Tools must be installed on every machine. If these conditions are met, it is recommended to use VMware FQDN template. The creation of VMware FQDN template became possible after introducing the ability to create hosts with custom interfaces in Zabbix 5.2.
A classic VMware template is still available and can be used if FQDN requirements cannot be met. Please keep in mind, that the VMware template has a known issue. Hosts for discovered virtual machines will be created with the names saved in the vCenter (for example, VM1, VM2, etc.). If Zabbix agent active is installed on these hosts later with autoregistration enabled, the autoregistration process will read host names as they have been registered upon launch (for example, vm1.example.com, vm2.example.com, etc.) and create new hosts since no name matches have been found. As a result, there will be two duplicate hosts for each machine with different names.
Templates used by discovery (normally, these templates should not be manually linked to a host):
To use VMware simple checks the host must have the following user macros defined:
The following example demonstrates how to quickly setup VMware monitoring on Zabbix:
It is assumed that VMware installation is up and running.
The data gathered by VMware collector can be logged for detailed debugging using debug level 5. This level can be set in server and proxy configuration files or using a runtime control option (-R log_level_increase="vmware collector,N"
, where N is a process number).
For example, if debug level 4 has already been set, you can increase it to level 5 by running:
Increase log level of all vmware collectors:
shell> zabbix_server -R log_level_increase="vmware collector"
Increase log level of the second vmware collector:
shell> zabbix_server -R log_level_increase="vmware collector,2"
If extended logging of VMware collector data is not required it can be stopped using the -R log_level_decrease
option.
config.vpxd.stats.maxQueryMetrics
parameter to the vCenter Server settings. The value of this parameter should be the same as the value of maxQuerysize
in VMware's web.xml. See the VMware knowledge base article for details.