Configuring Zabbix for VMware

When we talk about virtualization, there are many solutions in the market these days. The biggest player is still VMware, and Zabbix made it much easier for us to monitor our VMware infrastructure. In this recipe, we will show you how to set up VMware monitoring in Zabbix.

Getting ready

For this recipe to work, we need of course, a Zabbix server with the necessary admin rights and of course a VMware server that we can monitor. VMware monitoring is available since Zabbix 2.2. The minimum required version of VMware vCenter or vSphere is 4.1.

How to do it…

If you compile Zabbix, then make sure that you compile it with the --with-libxml2 and --with-libcurl options, else VMware monitoring will not work.

  1. Since we make use of the packages, the only thing we have to do first is to enable the following options in the zabbix_server.conf file:
    • StartVMwareCollectors = 1
    • VMwareCacheSize = 8M
    • VMwareFrequency = 60
  2. Make sure you restart the Zabbix server after changes have been made to the zabbix_server.conf file.
  3. Next, we create a new host for our vCenter in Zabbix under Configuration | Hosts, just like we would with any other server.
  4. When our host is added, we have to link it to the correct template. Zabbix provides for this with a pre-made template named Template Virt VMware:
    How to do it…
  5. Next we have to add some credentials. Zabbix needs a VMware account that has access to the API. Under Configuration | Hosts, there is a tab Macros where we have to create 3 macros. First is {$PASSWORD}, we also need to add {$USERNAME} and {$URL}.
    How to do it…

The username and password are obvious. For the {$URL} field, we need to add the URL to the vCenter API; this should be https://MyVcenter/sdk where MyVcenter is the DNS name or even better the IP to your vCenter.

How it works…

Zabbix comes with some ready-made templates to monitor our VMware server. The only thing we need to do is provide Zabbix with the needed credentials such as the username, password, and the proper link to the SDK from our VMware server. It would be best if the account that we use here is an account that is only available for Zabbix as the credentials are easy to read by anyone with Zabbix administration rights.

There's more…

If the user is in a Windows domain, you need to define the macro {$USERNAME} such as this: MYDomainSomeUser.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset