Monitoring VMware vSphere with Zabbix

Zabbix is an open-source monitoring tool designed to oversee various components of IT infrastructure, including networks, servers, virtual machines, and cloud services. It operates using both agent-based and agentless monitoring methods. Agents can be installed on monitored devices to collect performance data and report back to a centralized Zabbix server.

Zabbix provides comprehensive integration capabilities for monitoring VMware environments, including ESXi hypervisors, vCenter servers, and virtual machines (VMs). This integration allows administrators to effectively track performance metrics and resource usage across their VMware infrastructure.

In this post, I will show you how setup Zabbix monitoring with VMware vSpehre infrastructure.

Requirements:

  • Zabbix server
  • Access to the VMware vCenter Server

1. Create zabbix service user in the vCenter

At first, let’s create service user on the vCenter that will be used by Zabbix server to collect data. To make life easier, in my in lab setup user zabbix@vsphere.local will have full Administrator privileges. But, Read-Only permissions should be enough.

1. In vSphere Client choose Menu -> Administration -> Users and Groups. From Users tab, select Domain vsphere.local and click ADD button to add a new user.

2. Type a username and password. Click ADD to create a new user.

3. Change tab to Groups and select Administrators group.

4. Find a new user zabbix, click on it and save. User is added to the Administrators group.

5. From the Host and Clusters view, choose vCenter name and go to the Permissions tab. Click Add button.

6. Choose a proper domain (vsphere.local), find user zabbix , set role to Administrator and check Propagate to children. Click OK to give that permissions.

2. Make changes on the Zabbix server

Next, we need to edit zabbix_server.conf. In this file we need to enable vmware collector process. It’s necessary to start VMware monitoring.

FYI, I have installed Zabbix server in version 7.0.4.

1. Edit a configuration file zabbix_server.conf

vim /etc/zabbix/zabbix_server.conf

2. Find StartVMwareCollectors parameter, delete “#” before it and change value from 0 to at least 2.
Save a file and exit.

Except for StartVMwareCollectors which is mandatory, it’s possible to enable and modify additional VMware parameters. More details about them, you can find HERE.
VMwareCacheSize
VMwareFrequency
VMwarePerfFrequency
VMwareTimeout


3. Restart zabbix-server service.

systemctl restart zabbix-server

3. Configure VMware template on Zabbix

1.Log in to the Zabbix server via GUI – http://zabbix_server/zabbix
Go to the Hosts section under Monitoring tab.

2. Create a new “Host”. Click Create Host in the right upper corner.

3. In the Host tab provide the following details:
Host name – type a name of the system that we want to monitor, here is VMware Infrastructure;
Templates – type/find template name “VMware”, more info about VMware template you can find HERE;
Host groups – find/type “VMware(new)” host group.
Than, go to the Macros tab.

4. In the Macros tab you need to provide 3 values/macros. These macros describes data that it’s needed to connect Zabbix to the VMware vCenter.

{$VMWARE.URL} – VMware service (vCenter or ESXi hypervisor) SDK URL (https://servername/sdk) that we want to connect;
{$VMWARE.USERNAME} – VMware service username created in the 1 section;
{$VMWARE.PASSWORD} – VMware service user password created in the 1 section.
Click Add button.

5. New Host was created and collecting data is in progress.

6. Depending on the size of the infrastructure, data collection takes different times. Once configured, Zabbix will automatically discover VMs and begin collecting performance data. Overview of the lates data, you can find in the Dashboard screen.

7. More specific and detailed data, you can find in the Latest data under the Monitoring tab.

In Host groups or Hosts type (or click “Select” button) the name of the item you are looking for. Name of the ESXi host, virtual machine, vCenter name, datastore or all VMware information.

Zabbix can collect various metrics from VMware using its built-in templates. These metrics include:
– CPU usage
– Memory consumption
– Disk I/O statistics
– Network traffic
– Datastore capacity

Summary

In summary, integrating Zabbix with VMware provides a robust solution for monitoring virtualized environments, enhancing visibility into system performance and resource utilization while enabling timely alerts and responses to operational issues.

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *