Это перевод страницы документации с английского языка. Помогите нам сделать его лучше.

4 Пример настройки мониторинга VMware

Обзор

В следующем примере описано, как настроить Zabbix для мониторинга виртуальных машин VMware. Это включает в себя:

  • создание узла сети, представляющего среду виртуализации VMware;
  • создание правила низкоуровневого обнаружения, которое обнаруживает виртуальные машины в вашей среде виртуализации VMware;
  • создание прототипа узла сети, на основе которого Zabbix будет генерировать реальные узлы сети для виртуальных машин, обнаруженных правилом низкоуровневого обнаружения.

Предварительные условия

В этом примере не рассматривается конфигурация VMware. Предполагается, что VMware уже настроено.

Прежде чем продолжить, установите параметр StartVMwareCollectors в файле конфигурации сервера Zabbix в значение 2 или более (значение по умолчанию — 0).

Create a host

1. Go to Data collectionHosts.

2. Create a 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").

  • 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

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

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:

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

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

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. Since host prototypes are blueprints for creating hosts through low-level discovery rules, most fields will contain low-level discovery macros. This ensures that the hosts are created with properties based on the content retrieved 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 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 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.

  • 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}]).

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.

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, if necessary.

To view the created hosts, navigate to the Data collectionHosts menu section.

To view collected metrics, navigate to the MonitoringHosts menu section and click Latest data for one of the hosts.