HowtoForge

How to monitor VMware vSphere with Checkmk

Monitoring your virtualized server environments is the ideal way to ensure optimal utilization of hardware resources and the best possible performance of your IT infrastructure. VMware comes with some basic on-board monitoring tools, but you should rather go for a vendor-agnostic monitoring tool that is also able to monitor other IT assets such as server hardware and networks.

Kick-start your VMware monitoring with just a few simple steps

In this tutorial, I will show you how to monitor your vSphere with the open-source monitoring tool Checkmk in just a few minutes. This will help you to get started with your VMware monitoring. You do not need any monitoring experience to follow the steps below. After finishing this tutorial, you get the basics of Checkmk’s rule-based monitoring approach and will be ready to take on further monitoring challenges.

Prerequisites

You need a running Checkmk environment. For this tutorial, I am using the Checkmk Raw Edition (I am using version 2.1.0.p14), which you can download from the Checkmk website. You can follow this tutorial on how to get started with Checkmk or check out this video to start your monitoring.

As an example, I will use VMware vCenter, in which I have created three virtual machines. However, Checkmk is really scalable, and it doesn't really matter how many VMs you have – the effort is almost the same. Checkmk leverages the VMware API to get all the available information from vCenter and your ESXi hosts.

To enable Checkmk to retrieve the data, you need a read-only user with permissions for the entire inventory of your VMware vCenter server. Using an account with read-only permissions is security sensitive. You should never grant additional rights for your monitoring user account. In my case, I called the vCenter user ‘checkmk’ and I am using the vSphere default domain ‘vsphere.local’. Thus, later in Checkmk, I will use ‘checkmk@vsphere.local’ to grant Checkmk access.

Technically, you do not need a naming convention within your VMware environment to follow this tutorial. However, a proper naming policy is extremely essential for a virtualized server environment, especially if you want to drill deeper into VMware monitoring. Thus, I recommend using fully-qualified DNS names (FQDN). This blog about naming concepts provides a guide on how to find a proper naming convention. In my example, my vCenter server is called ‘vm-vcenter-01.lan.domain.net’.

Step 1: Add vCenter as a host to the monitoring

All it takes is three simple steps, so let us get started. Open your Checkmk site and create a folder for your VMs.

Folder structures are an easy, yet powerful way to organize your monitoring. Thus, you should have hosts of the same kind together in one folder. In this tutorial, the vCenter server is the only VM you add, but you might add more in the future.

Step 2: Prepare the VMware monitoring rule

Checkmk cannot gather data from vCenter yet, because it does not have access to the VMware API. In this step, you will use the vSphere monitoring rule in Checkmk to decide which information Checkmk should collect.

The last option is related to the Piggyback mechanism. This feature allows Checkmk to gather data for monitoring hosts not from them directly, but through another host. vCenter can, for example, provide monitoring data for your VMs. Once the data is in your monitoring, Checkmk needs to find the right host for each piece of data and assumes by default that the host name in Checkmk is the same as the display name in VMware.

However, Checkmk does not allow spaces in host names. If display names have spaces, Checkmk will replace them with underscores by default. With Piggyback name of virtual machines, you can tell Checkmk to cut off the host name after a space sign instead.

For me, the configuration looks like this:

Step 3: Run the automated service discovery

Your vCenter host is now ready to retrieve monitoring data via the VMware API. For this, you should start the automatic service discovery in Checkmk for your vCenter host.

My three VMs have been detected:

Checkmk detects all VMs configured in vCenter, and maybe more than that. Be aware that the VMware API does not allow differentiating between VMs and templates, for example. Checkmk would see them as switched off VMs, as well. Thus, the services will be on WARN and I suggest that you deactivate these services by clicking on the X symbol, so they do not cause any false alerts.

Your vCenter server is now monitored. It is time to check it out:

Next steps to a holistic VMware monitoring

And you made it, this tutorial ends here! You covered the first basic step of holistic monitoring of your VMware environment, but your VMware monitoring has a few shortcomings. For instance, you do not monitor your server hardware and also did not include the information provided by your ESXi hosts. Also, your VMs are merely monitored as services of your vCenter host and are not configured as independent monitoring hosts. You literally just check if they are online, but you actually should drill a lot deeper.

This guide about monitoring VMware with Checkmk will show you all the steps necessary to monitor VMware properly. You actually already took an important step, but there is more to do. If you want to know why VMware monitoring is such a big deal, I can recommend this page with more general information about server monitoring.

How to monitor VMware vSphere with Checkmk