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)”.
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.
In the Check state of VMware ESX via vSphere section:
- Provide an account with read-only permission for the vCenter Server. For this POC I used the email@example.com 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.
- If you haven’t changed the TCP port for vCenter communications, accept the default. At this time we do not worry about SSL certificates.
- Retrieve Information about: As we already have some understanding what to expect from these settings, we select all options.
- Display ESX Host power state on: select “The queried ESX system (vCenter / Host)
- Display VM power state on: select “The Virtual Machine”
- Type of Query: select “Queried host is the vCenter with Check_MK Agent installed”
- 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.
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.
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:
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.
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.
- SSH to the VCSA.
- Before we launch the shell, we need to enable it by setting:
> set –enabled True
- 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!
- Reboot the VCSA.
- 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.
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.