[comment]: # translation:outdated

[comment]: # ({new-4bfd390b})
# 4 VMware monitoring setup example

[comment]: # ({/new-4bfd390b})

[comment]: # ({new-80b8c08f})
#### Overview

The following example describes how to set up Zabbix for monitoring VMware virtual machines. This involves:

- creating a host that represents your VMware environment;
- creating a low-level discovery rule that discovers virtual machines in your VMware environment;
- creating a host prototype, based on which Zabbix will generate real hosts for virtual machines discovered by the low-level discovery rule.

[comment]: # ({/new-80b8c08f})

[comment]: # ({new-ecff358b})
#### Prerequisites

::: noteclassic
This example does not cover the configuration of VMware. It is assumed that VMware is already configured.
:::

Before proceeding, set the [`StartVMwareCollectors`](/manual/appendix/config/zabbix_server#startvmwarecollectors) parameter in Zabbix server configuration file to `2` [or more](/manual/vm_monitoring#configuration) (the default value is `0`).

[comment]: # ({/new-ecff358b})

[comment]: # ({new-6dcff943})
#### Create a host

1\. Go to [*Data collection* → *Hosts*](/manual/web_interface/frontend_sections/data_collection/hosts).

2\. [Create a host](/manual/config/hosts/host):

- In the *Host name* field, enter a host name (for example, "VMware VMs").
- In the *Host groups* field, type or select a host group (for example, "Virtual machines").

![](../../../assets/en/manual/vm_monitoring/vmware_host.png){width="600"}

- In the *Macros* tab, set the following host macros:
    - {$VMWARE.URL} - VMware service (ESXi hypervisor) SDK URL (https://servername/sdk)
    - {$VMWARE.USERNAME} - VMware service user name
    - {$VMWARE.PASSWORD} - VMware service {$VMWARE.USERNAME} user password

![](../../../assets/en/manual/vm_monitoring/vmware_host_macros.png){width="600"}

3\. Click the *Add* button to create the host. This host will represent your VMware environment.

[comment]: # ({/new-6dcff943})

[comment]: # ({new-17a3b438})
#### Create a low-level discovery rule

1\. Click *Discovery* for the created host to go to the list of low-level discovery rules for that host.

2\. [Create a low-level discovery rule](/manual/discovery/low_level_discovery#configuring-low-level-discovery):

- In the *Name* field, enter a low-level discovery rule name (for example, "Discover VMware VMs").
- In the *Type* field, select "[Simple check](/manual/config/items/itemtypes/simple_checks)".
- In the *Key* field, enter the built-in item key for discovering VMware virtual machines: [vmware.vm.discovery[{$VMWARE.URL}]](/manual/vm_monitoring/vmware_keys#vmware.vm.discovery).
- In the *User name* and *Password* fields, enter the corresponding macros previously configured on the host.

![](../../../assets/en/manual/vm_monitoring/vmware_host_discovery.png){width="600"}

3\. Click the *Add* button to create the low-level discovery rule.
This discovery rule will discover virtual machines in your VMware environment.

[comment]: # ({/new-17a3b438})

[comment]: # ({new-d98be400})
#### Create a host prototype

1\. In the list of low-level discovery rules, click *Host prototypes* for the previously created low-level discovery rule.

2\. [Create a host prototype](/manual/discovery/low_level_discovery/host_prototypes#configuration).
Since host prototypes are blueprints for creating hosts through low-level discovery rules, most fields will contain [low-level discovery macros](/manual/config/macros/lld_macros).
This ensures that the hosts are created with properties based on the [content retrieved](/manual/vm_monitoring/discovery_fields) by the previously created low-level discovery rule.

- In the *Host name* field, enter the macro {#VM.UUID}.
- In the *Visible name* field, enter the macro {#VM.NAME}.
- In the *Templates* field, enter or select the "VMware Guest" template.
This template contains [VMware items](/manual/vm_monitoring/vmware_keys) and discovery rules for monitoring the power state of a virtual machine, CPU usage, memory usage, network devices, etc.
- In the *Host groups* field, enter or select a host group (for example, "Discovered hosts").
- In the *Interfaces* field, add a custom [host interface](/manual/discovery/low_level_discovery/host_prototypes#host-interfaces) and, in the *DNS name* field, enter the macro {#VM.DNS}.
Alternatively (based on the configuration of your VMware environment), in the *IP address* field, enter the macro {#VM.IP}.
This is necessary for the correct functioning of the *VMware Guest* template.

![](../../../assets/en/manual/vm_monitoring/vmware_host_prototype.png){width="600"}

- In the *Macros* tab, set the {$VMWARE.VM.UUID} macro with the value {#VM.UUID}.
This is necessary for the correct functioning of the *VMware Guest* template that uses this macro as a host-level user macro in item parameters
(for example, *vmware.vm.net.if.discovery\[{$VMWARE.URL}, {$VMWARE.VM.UUID}\]*).

![](../../../assets/en/manual/vm_monitoring/vmware_host_prototype_macros.png){width="600"}

3\. Click the *Add* button to create the host prototype.
This host prototype will be used to create hosts for virtual machines discovered by the previously created low-level discovery rule.

[comment]: # ({/new-d98be400})

[comment]: # ({new-ec62c44a})
#### View hosts and metrics

After the host prototype has been created, the low-level discovery rule will create hosts for discovered VMware virtual machines, and Zabbix will start to monitor them.
Note that the discovery and creation of hosts can also be [executed manually](/manual/config/items/check_now), if necessary.

To view the created hosts, navigate to the [*Data collection* → *Hosts*](/manual/web_interface/frontend_sections/data_collection/hosts) menu section.

![](../../../assets/en/manual/vm_monitoring/vmware_discovered_hosts.png){width="600"}

To view collected metrics, navigate to the [*Monitoring* → *Hosts*](/manual/web_interface/frontend_sections/monitoring/hosts) menu section and click *Latest data* for one of the hosts.

![](../../../assets/en/manual/vm_monitoring/vmware_monitored_hosts.png){width="600"}

[comment]: # ({/new-ec62c44a})
