Check_MK and vSphere – vCenter Server

This post is the third part in a series about Check_MK and vSphere. In the second part, I showed you the options for monitoring an ESXi host without using vCenter Server. In this post we will explore the options for monitoring a vCenter Server on Windows and also the vCenter Server Appliance (VCSA).

vCenter Server Windows

For this POC we have a vCenter Server 6.0 U2 (build 3634793) on a Windows Server 2012 R2. As this is a normal Windows server, I installed the Check_MK agent for Windows and added the host to Check_MK. For the property Agent type, select “Check_MK Agent (Server)”.

2016-08-21_01Figure 1

By default the Check_MK Windows Agents presents – without further tweaking – a lot of information; CPU and Memory utilization, Disk I/O, status of the filesystems, status of the Network interfaces and many more.

Now it’s time to reveal the vSphere options. We follow the same procedure as we did for the ESXi host. In the WATO configuration go to Host & Service Parameters \ Datasource Programs and select Check state of VMware ESX via vSphere. Now create a second rule for the vCenter Server, start with providing a descriptive name.

2016-08-21_02Figure 2

In the Check state of VMware ESX via vSphere section:

  1. Provide an account with read-only permission for the vCenter Server. For this POC I used the administrator@vsphere.local account, which is a bad idea in a production environment.
    Make sure the account has sufficient rights; otherwise you will receive neither output nor an error message.
  2. If you haven’t changed the TCP port for vCenter communications, accept the default. At this time we do not worry about SSL certificates.
  3. Retrieve Information about: As we already have some understanding what to expect from these settings, we select all options.
  4. Display ESX Host power state on: select “The queried ESX system (vCenter / Host)
  5. Display VM power state on: select “The Virtual Machine”
  6. Type of Query: select “Queried host is the vCenter with Check_MK Agent installed”
  7. Placeholder VMS: place a tick

Under the Conditions Section, we must specify the host name for the vCenter Server. Use the same name as during the host configuration.

2016-08-21_03Figure 3

Now save your settings and return to the Host we have just created and check for the new services; the result is shown in Figure 4.

2016-08-21_04Figure 4

The following checks have been added to the vCenter Server:

  • esx_vsphere_datastores, shows all datastores (shared and local!) connected to ESXi hosts managed by the vCenter Server.
  • esx_vsphere_licenses, shows all VMware licenses stored on the vCenter Server (in fact the License Manager on the Platform Services Controller)
  • esx_vsphere_objects, shows connected ESXi hosts and VMs running on these hosts.

Now we notice:

  • Ticking the Performance Counters has no effect.
  • For connected ESXi servers, the power state is shown, but no further information. However, we have an overview of connected ESXi hosts. To retrieve more information, we will need to add all ESXi hosts to Check_MK.
  • The following checks provide redundant information (esx_vsphere_datastores, esx_vsphere_licenses and esx_vsphere_objects for the VMs). We don’t want to receive multiple alarms for the same issue, so we must consider how to configure the rules for the vCenter Server and the managed ESXi hosts.

For the vCenter Server we configure the rule as follows:

  • Host Systems, Select, will show all connected ESXi hosts.
  • Virtual Machines, Select, will show the status of all VMs in the Inventory and adds extra checks to the VMs. Choose for Display VM power state on is set on “The queried ESX system (vCenter / Host)” or “The Virtual Machine”.
  • Datastores, Select, will show the status of all datastores.
  • Performance Counters, do not Select, as this will produce no output.
  • License Usage, Select, will show an overview of all licenses.

For each ESXi host managed by a vCenter Server we configure the rule:

  • Host Systems, Select, will show detailed status of the ESXi host.
  • Virtual Machines, do not Select, already set on the vCenter Server.
  • Datastores, do not Select, already set on the vCenter Server.
  • Performance Counters, Select, will show performance counters of the ESXi hosts.
  • License Usage, do not Select.

For monitoring ESXi hosts not managed by a vCenter Server, you will select all options. To give you an impression of the status of the vCenter Server after configuring the rule as described and no further tweaking:

2016-08-21_05Figure 5

2016-08-21_06Figure 6

The yellow marked sections are the vSphere / vCenter specific sections, like the status of the Datastores, ESXi hosts and licensing. The checks within the red border are the vSphere related checks for a VM. The other checks are the default Checks for a Windows VM. There is no clear separation between the vSphere specific checks and the “default” checks for a Windows VM.

vCenter Server Appliance

How about the vCenter Server Appliance? We can also monitor the vCenter Server Appliance in a similar method, however there is one condition, we must allow incoming traffic on port 6556. The VCSA has a nice graphical management interface; unfortunately it does not allow creating a rule to open a port. The nice folks at Sightline systems encountered the same issue and published a useful workaround, outlined in this post. For the VCSA proceed as follows.

  1. SSH to the VCSA.
  2. Before we launch the shell, we need to enable it by setting:
    > set –enabled True
    followed by:
    > shell
  3. Edit the file /etc/vmware/appliance/services.conf. Add the lines as outlined in figure 7. Do not forget the comma. Save the file.
    Advice: Before you edit the file, make a copy!

2016-08-21_07Figure 7

  1. Reboot the VCSA.
  2. After rebooting the VCSA, it is time to switch over to the WATO interface.

In WATO, first step is adding the VCSA as a host followed by the same procedure as outlined for the vCenter Server. After adding a rule, the result should look something like this.

2016-08-21_08Figure 8

Notice: because we have not installed a Check_MK agent in the VCSA we receive no information about the host OS. Although the vCenter Server Appliance is based on SUSE Linux Enterprise 11, it should be able to install a Check_MK agent, BUT I suppose this not supported by VMware, so consider if you want to do this in a production environment!

In an upcoming post, we will  discuss some more vSphere related monitoring with Check_MK. As always I thank you for reading and welcome your comments.


8 Responses to Check_MK and vSphere – vCenter Server

  1. mike says:

    nice guide! have you test the VCSA configuration with 6.5 too? thanks

    • paulgrevink says:

      Hi Mike,

      Not yet, I will probably have a look in the near future.

      Best regards,

    • Dan says:

      Today we upgraded our vCenter from 6.0 to 6.5 and everything works fine. FW exception is on same place and Check_mk can connect to vCenter with Agent+snmp monitoring type without problems.

  2. Richard says:

    Does this also work for the 5.5 VMware vCenter appliance?

  3. DCA says:

    How we can install check_mk_agent on Photon ?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: