11th ChapterVmwareMonitoring
as the application of virtualization technology becomes more and more widespread, Zabbix , as an infrastructure monitoring system, can also support VMware -based virtualization platforms and virtual machines for monitoring. use low-level discovery rules to automatically discover VMware by using a pre-defined host prototypes(mainframe prototype) in Zabbix Hypervisors and virtual machines, and create hosts to monitor them.
in the The monitoring of virtual machines in Zabbix is done in two steps , starting with the collection of virtual machine data through Vmwarecollector instances that use the SOAP protocol from the VMware Web services collect the information you need and then save it to Zabbixserver in shared memory, and then pollers uses Zabbix simple check to receive the data.
supported by the minimum version of VMware vCenter or vSphere is v4.1.
11.1Configuration Preparation
monitoring Vmware support Libxml2 (Used to parse the call to soap interface returns Xml Libcurl vcenter Soap start error: cannotstart vmware Collector because Zabbix Server is built without VMware support zabbix –WITH-LIBXML2 and –with-libcurl these two parameters.
In addition, we need to modify The parameters for VMware monitoring in the configuration file /etc/zabbix/zabbix_server.conf of the Zabbix server are mainly as follows:
Startvmwarecollectors:number of VMware collector instances, default = 0, Value range:0-250. This value depends on the number of VMware services you need to monitor . Typically Servicenum < Startvmwarecollectors < (Servicenum * 2), where servicenum VMware The number of services.
Vmwarefrequency: The frequency at which a new data is collected byconnecting to the VMware service, by default , the value range:10-86400.
Vmwareperffrequency: The frequency at which the performance data is collected by the VMware service, which defaults to a value range of 10-86400.
Vmwarecachesize: Cache capacity for storing VMware data, default is 8M, value range:256k-2g.
Vmwaretimeout:The time that VMware Collector waits for a VMware service response, the default is ten seconds, and the value range:1-300.
Once you have configured the relevant parameters, remember to restart Zabbix server.
you may have noticed Although both vmwarefrequency and vmwareperffrequency are definitions of how often data is collected, there are some differences between the two parameters. Zabbix from the 2.4.4 version, the data collected from VMware is divided into two categories:vmwareconfiguration data(configuration) and Vmwareperformance counter Data(performance counter statistics), which are collected through VMware collector , so the recommended number of vmwarecollector is greater than VMware performance counter data due to VMware configuration data not being updated in a timely manner Collection of delays.
11.2Preset Templates
in the Several templates for monitoring vmwarevcenter or ESX hypervisor that can be used directly are available in Zabbix , which contain pre-defined low-level Discovery rules.
Template Virt vmware templates are used whenmonitoring Vmwarevcenter and ESX hypervisor, template Virt vmware hypervisor and template Virt VMware Guest are primarily used in Discovery and do not have to link these two templates manually on host. As shown in the 11-1.
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/96/FC/wKiom1kntiKj_9seAAA6iwpXeSU568.png "title=" 1.png "alt=" Wkiom1kntikj_9seaaa6iwpxesu568.png "/>
Figure 11-1
If you are from When upgrading to the 3.0 version of Zabbix 2.2 or earlier , you need to download the template from the official website and import it manually. Because these templates rely on the value maps of vmware virtualmachinepowerstate and vmware status, you need to create them manually or from XML Import, you can also use SQL scripts (Http://www.zabbix.org/wiki/Zabbix_Templates/SQLs_for_Official_ Templates) To establish these value mappings, and then import these templates.
11.3CreateVMware Host
before creating the host, log in to VCenter to confirm that the service is working correctly. Then click on Configuration--> hosts on the Zabbix front page and click the Create Host buttonin the upper right corner of the hosts page . Complete the following configuration on the Host Configuration page:
1. Click the Host tab, enter host name and Visible name in the configuration page, select the appropriate group. As shown in the 11-2.
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/96/FD/wKioL1kntjKQyx6WAACPpOzJpfg836.png "title=" 2.png "alt=" Wkiol1kntjkqyx6waacppozjpfg836.png "/>
Figure 11-2
2, Agent Interface in the IP address input vCenter server addresses, collect data do not use this address, set here for the purpose is convenient management.
3. Click the Templates tab and add the Templatevirt VMware template to the configuration page. As shown in the 11-3.
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/96/FD/wKioL1kntkCAHm5WAAA2xVzocDA334.png "title=" 3.png "alt=" Wkiol1kntkcahm5waaa2xvzocda334.png "/>
Figure 11-3
4, click Macros tags, add host macro variables to the configuration page. As shown, there are mainly 3
-
{$USERNAME }: VMware user name.
-
{$PASSWORD}: VMware user password.
-
{$URL}: VMware service ( vcenter or ESX hypervisor< Span style= "font-family: ' The song Body '; >) SDK url HTTPS://SERVERNAME/SDK
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/96/FD/wKioL1kntk6RkM-zAABLRsfkqSQ520.png "title=" 4.png "alt=" Wkiol1kntk6rkm-zaablrsfkqsq520.png "/>
Figure 11-4
5. Click the Add button to save the configuration.
vmware host After the creation is complete, Zabbix interface access VMware vcenter and gather all the information, Through the template Virt vmware discovervmware Hypervisors find corresponding hypervisor and Vm (virtual machine).
in the In the Discover VMware hypervisors Discovery rule, a host prototypes is defined, and the Template Virt VMwareis linked in the host prototype Hypervisor template. in the Discover VMware VMs Discovery rule, a hostprototypes(host prototype) is defined, and the Templatevirt VMware Guest is linked in the host prototype template. When hypervisor or virtual machines are discovered, these host prototypes become real hosts . The host prototype is defined as shown in 11-5 .
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/96/FC/wKiom1kntl6iCpaXAACbb0tLuhk582.png "title=" 5.png "alt=" Wkiom1kntl6icpaxaacbb0tluhk582.png "/>
Figure 11-5
in the The default configured updateinterval in Discovery rules is 3600 seconds, so These discovery rules are run one hours after the creation of the VMware host, discovering and creating hypervisor and VM hosts. Browse through hypervisor or cluster filtering in the monitoring-to-Latest data page .
If a problem is encountered, we can VMware collector 's Extended debug mode (Debug Level 5) obtains detailed data collection. You need to modify the Zabbixserver configuration file to set the debug level, or use the parameter -R log_level_increase= "VMware collector,n", N is the number of the process. Let's take a look at the following example.
assuming that the debug level is set to 4, the debug level for all VMware collector processes isset to 5:
# zabbix_server-r log_level_increase= "VMware Collector"
set up a second The debug level for the VMware collector process is 5:
# zabbix_server-r log_level_increase= "VMware collector,2"
do not need to you can use the parameter -rlog_level_decrease option when the data for VMware collector is Extendeddebug .
650) this.width=650; "src=" https://s2.51cto.com/wyfs02/M01/96/FC/wKioL1knqe7xryFhAAI2BInbOqg532.jpg "width=" 764 " height= "226" alt= "wkiol1knqe7xryfhaai2binboqg532.jpg"/>
This article is from http://ustogether.blog.51cto.com/8236854/1929738, please contact the author if you need to reprint.
This article from "Big White small Bai together to learn" blog, reprint please contact the author!
Zabbix 3.0--11th VMware monitoring