There are a lot of virtualization solutions available today. Their target markets and popularity differ, but for enterprise shops that can afford it, VMware solutions are quite widespread. Zabbix offers built-in support for monitoring VMware. This support includes:
Monitoring VMware does not involve any custom layers—Zabbix accesses the VMware API directly, and the monitoring of such an environment is very easy to set up. For this chapter, you will need access to a VMware instance API, including a username and password. It might be a good idea to try this on a smaller or non-production environment first.
If discovering a large environment from a vCenter, the vCenter API endpoint could get overloaded, as Zabbix would connect to it and request data for all the vSphere instances and virtual machines that have been discovered. It might make sense to split the monitoring over individual vSphere instances instead.
To try out VMware support, we will need:
First, the server must be compiled with VMware support. If you have installed from packages, the support most likely is included. If you installed from source, check whether the Zabbix server log file lists VMware monitoring as enabled:
VMware monitoring: YES
When compiling from source, the following options are needed for VMware support:
--with-libcurl
--with-libxml2
As with several other features we have explored so far, the Zabbix server doesn't start any VMware-specific processes by default. Edit zabbix_server.conf
and look for the StartVMwareCollectors
parameter. Add a new line and tell Zabbix to start two VMware collectors:
StartVMwareCollectors=2
Restart the server. Why two collectors? Zabbix developers recommend the number of the collectors to be based on the number of monitored VMware instances. For the best performance, it is suggested to start more collectors than the monitored instance count, but less than double the monitored instance count. Or, if we put that in an equation, instances < StartVMwareCollectors < ( instances * 2 )
. We start small and monitor a single instance for now, so we'll have 1 < StartVMwareCollectors < 2
. It is also recommended to always start at least two VMware collectors, so the choice is obvious here. If we had two VMware instances to monitor, it would be three collectors: 2 < StartVMwareCollectors < 4
.
We will start by unleashing Zabbix at the VMware API and allowing it to automatically discover everything using the templates that are shipped with Zabbix. Once we see that it works as expected, we will discover how we can customize and expand this monitoring, as well as looking under the hood a bit at the mechanics of VMware monitoring.