Posted on

Hey there…! Thank you for reading this blog. Since I am not a native English speaker, I might have too many Grammar issues & Typo in all of the blogs. So, Help me correct them ;-). Your feedback is really important to make this blog useful for others.

Requirements

Since every version might has its own changes, Its good to know our blog post has tested these versions:

  • VMware vCenter: Version 6.7
  • Zabbix: Version 4.2
  • Grafana: Version 6.2.5 (commit: 6082d19, branch: HEAD)

In order to install & configure Zabbix and Grafana we have shared two blgo post which is a step by step guide. Part 1 is about how to install Zabbix on Ubuntu server & Part 2 is describing all the things that you need to integrate Zabbix & Grafana.
If you have already installed Zabbix & Grafana, You might need to read Part 2 to install Zabbix App Plugin on your Grafana Instance.

Grafana Dashboards that you need to download:

I made 3 dashboards and published them on Grafana Website which you can download and install them on your Grafana server.

Zabbix Configuration

Zabbix has some default Templates which are really simple to configure and it will Discover (Low Level Discovery) your vCenters, Hypervisors and Virtual Machines from VMware SDK. Here are the steps you should go:

1- Zabbix Requirements

Be sure your Zabbix server has compiled with --with-libxml2 & --with-libcurl. Another thing that you should change is StartVMwareCollectors inside file /etc/zabbix/zabbix_server.conf

StartVMwareCollectors is the number of pre-forked vmware collector instance. Zabbix documentation recommends us to set it depends on the number of services your are going to monitor.
Here is the Zabbix documentation about setting StartVMwareCollectors:

servicenum < StartVMwareCollectors < (servicenum * 2) where servicenum is the number of VMware services. E. g. if you have 1 VMware service to monitor set StartVMwareCollectors to 2, if you have 3 VMware services, set it to 5. Note that in most cases this value should not be less than 2 and should not be 2 times greater than the number of VMware services that you monitor”

2- Add Host Groups

The provided dashboards are using Zabbix Host Groups to plot the information you want on the panels. So, We need to add 2 host group on our Zabbix server. To do that:

  1. Click on Configuration
  2. and choose Host groups
  3. Then click on Create host group

Zabbix Host Group

Type Hypervisors in “Group name” field and click Add button.

Zabbix Host Group

Do the same thing to add another group and add group Virtual machines

Zabbix Host Group

3- Edit the default Templates

Since our dashboards will look for a the Host Groups which we made before, We need to edit Zabbix pre-defined templates.

Edit Template VM VMware

Open your Zabbix Web Interface and follow the further steps:

  1. Click on Configuration
  2. Then click on Templates
  3. After that, to see only the template related to VMware, type “vmware” inside Name textbox.
  4. Click on Apply button to filter our the list.
  5. In Template VM VMware click on Discovery rule.

Zabbix VM VMware Template

In this page, In the Discover VMware hypervisors click on Host Prototype

Zabbix VM VMware Template

Click on {#HV.NAME}

Zabbix VM VMware Template

  1. Then, Click on Groups
  2. On the Group textbox type Hypervisors and select it from the list
  3. To update list, Click on Update button.

Zabbix VM VMware Template

Again, Do the same thing to edit Virtual Machine Low Level Discovery rules.

  1. Click on Configuration
  2. Then click on Templates
  3. After that, to see only the template related to VMware, type “vmware” inside Name textbox.
  4. Click on Apply button to filter our the list.
  5. In Template VM VMware click on Discovery rule.

Zabbix VM VMware Template

In this page, In the Discover VMware VMs click on Host Prototype

Zabbix VM VMware Template

Click on {#HV.NAME}

Zabbix VM VMware Template

  1. Then, Click on Groups
  2. On the Group textbox type Virtual machines and select it from the list
  3. To update list, Click on Update button.

Zabbix VM VMware Template

Adding Host to Zabbix

The only things we need to do in Zabbix side is adding new Host. To do that follow the further steps:

  1. On your Zabbix Web interface, click on Configuration
  2. Then click on Hosts
  3. To add new host click on Create host button

Zabbix Add Host

On the Host tab, choose a name as you wish. eg: “vCenter Server” and select or create Groups.

Zabbix Add Host

To be able to discover our VMware infrastructure, click on Templates and add Template VM VMware inside Linked templates

Zabbix Add Host

Zabbix need a user in your VMware vSphere with read-only access to fetch metrics that we wants from our VMware infrastructure. Go to Macros tab and add three macros:

  • {$URL}: Address to your vCenter Server: eg: https://vcenter.example.org/sdk
  • {$USERNAME}: vCenter username: eg: Administrator@vsphere.local
  • {$PASSWORD}: Password for the provided username

Zabbix Add Host

Click on Add button to add this host. and wait for some about 1 hour. Zabbix will discover your VMware infrastructure as shown in the screenshot.

Zabbix Low Level Discovery

Import Dashboards to Grafana

Before start this section, make sure you have integrated your Grafana with Zabbix and & add Zabbix Datasource in Grafana. To do that read this blog post

Download mentioned dashboards JSON files from the further links:

Create “Zabbix App Folder” Folder

In your Grafana Web interface, Click on PLUS button and click on Folder link.

Grafana Import Dashbaord

After that create a folder named From Zabbix App and click on Create Button.

Grafana Import Dashbaord

1- Import Dashboard: “Zabbix – VM Monitoring”

In your Grafana Web interface, Click on PLUS button and click on Import link.

Grafana Import Dashbaord

After that click on Upload .json File button and select “zabbix-vm-monitoring_rev{version number}.json” file. Once you selected “zabbix-vm-monitoring_rev{version number}.json” you need to do some changes:
  • Change Folder to “From Zabbix App”.
  • Select Zabbix datasource to your Zabbix Datasource. My Zabbix Datasource is “Zabbix”

Grafana Import Dashbaord

2- Import Dashboard: “Zabbix – Hypervisor – Overview”

In your Grafana Web interface, Click on PLUS button and click on Import link.

Grafana Import Dashbaord

After that click on Upload .json File button and select “zabbix-hypervisor-overview_rev{version number}.json” file. Once you selected “zabbix-hypervisor-overview_rev{version number}.json” you need to do some changes:
  • Change Folder to “From Zabbix App”.
  • Select Zabbix datasource to your Zabbix Datasource. My Zabbix Datasource is “Zabbix”

Grafana Import Dashbaord

3- Import Dashboard: “Zabbix – vCenter – Monitoring”

In your Grafana Web interface, Click on PLUS button and click on Import link.

Grafana Import Dashbaord

After that click on Upload .json File button and select “zabbix-vcenter-monitoring_rev{version number}.json” file. Once you selected “zabbix-vcenter-monitoring_rev{version number}.json” you need to do some changes:
  • Change Folder to “From Zabbix App”.
  • Select Zabbix datasource to your Zabbix Datasource. My Zabbix Datasource is “Zabbix”

Grafana Import Dashbaord

Conclusion

After doing all the steps mentioned in this blog posts, You will have “From Zabbix App” Folder in your Grafana Web Interface  that includes three dashboards which look like the further screenshots. If you have any question about this blog post, you can ask it in the comment section or directly from email OR my social media accounts. At the end, THANK YOU for reading this blog post.

Grafana Zabbix | VMware Dashbaord
Grafana Zabbix | VMware Dashbaord
Grafana Zabbix | VMware Dashbaord

Leave a Reply

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