Information and Monitoring Guide 2.0

The Information Manager (IM) is in charge of monitoring the cluster nodes. It comes with various sensors, each one responsible of a different aspects of the computer to be monitored (CPU, memory, hostname…). Also, there are sensors prepared to gather information from different hypervisors (currently KVM and XEN).

Requirements

Depending on the sensors that are going to conform the IM driver there are different requirements, mainly the availability of the hypervisor corresponding to the sensor if one of the KVM sensor or XEN sensor are used at all. Also, as for all the OpenNebula configurations, SSH access to the hosts without password has to be possible.

Driver Files

This section details the files used by the Information Drivers to monitor the cluster nodes. This files are placed in the following directories:

  • $ONE_LOCATION/lib/mads/: The drivers executable files
  • $ONE_LOCATION/var/remotes/im/common.d: Common probes to gather each monitoring metric
  • $ONE_LOCATION/var/remotes/im/<virtualizer>.d: Specific probes for a virtualizer.

Note: If OpenNebula was installed in system wide mode these directories become /usr/lib/one/mads and /var/one/remotes/im and respectively. The rest of this guide refers to the $ONE_LOCATION paths (corresponding to self contained mode) and omits the equivalent system wide locations. More information on installation modes can be found here

Note: If you delete the remote files placed inside the “var” directory, there is also a back up of these files inside the “lib” directory of the OpenNebula installation. But remember, the folder that will be copied to the remote hosts is “var/remotes”.

Common files

These files are used by the IM regardless of the hypervisor present on the machine to be monitored:

  • $ONE_LOCATION/lib/mads/one_im_ssh : shell script wrapper to the driver itself. Sets the environment and other bootstrap tasks.
  • $ONE_LOCATION/lib/mads/one_im_ssh.rb : The actual Information driver.
  • $ONE_LOCATION/var/remotes/im/*.d : sensors home. Little scripts or binaries that extract information from the remote hosts. Let's see a simple one to understand how they work:

<xterm> $> cat $ONE_LOCATION/var/remotes/im/common.d/name.sh #!/bin/sh

echo NAME=`uname -n` </xterm>

This uses the uname command to get the hostname of the remote cluster host, and then outputs the information as:

NAME=host1.mydomain.org

Probe execution

:!: There is always one obligatory attribute set by all the Information Drivers, HYPERVISOR set to the kind of hypervisor (XEN, KVM, VMWare, EC2, etc) present on the host this particular Information Driver is monitoring.

Files contained in remotes/im/common.d and remotes/im/<virtualizer>.d are executed in the remote host. You can add more files to this directories to get more information.

Information Driver is also the responsible to copy all this scripts (and Virtual Managament driver scripts) to remote nodes. If you want it to refresh probes on the remote nodes you have to use the following command:

$ onehost sync

This way in the next monitoring cycle the probes and VMM Driver action scripts will be copied again to the node.

Configuration on where to copy these files on the remote nodes is done in etc/oned.conf, the parameter is called SCRIPTS_REMOTE_DIR, by default is set to /var/tmp/one.

OpenNebula Configuration

The OpenNebula daemon loads its drivers whenever it starts. Inside $ONE_LOCATION/etc/oned.conf there are definitions for the drivers. The following lines, will configure OpenNebula to use the Xen probes:

IM_MAD = [
    name       = "im_xen",
    executable = "one_im_ssh",
    arguments  = "xen" ]

Equivalently for KVM, you'd put the following in oned.conf:

IM_MAD = [
      name       = "im_kvm",
      executable = "one_im_ssh",
      arguments  = "kvm" ]

And finally for EC2:

IM_MAD = [
      name       = "im_ec2",
      executable = "one_im_ec2",
      arguments  = "im_ec2/im_ec2.conf" ]

Please remember that you can add your custom probes for later use by other OpenNebula modules like the scheduler.

Testing

In order to test the driver, add a host to OpenNebula using onehost, specifying the defined IM driver:

<xterm> # onehost create ursa06 im_xen vmm_xen tm_ssh </xterm>

Now give it time to monitor the host (this time is determined by the value of HOST_MONITORING_INTERVAL in $ONE_LOCATION/etc/oned.conf). After one interval, check the output of onehost list, it should look like the following:

<xterm> HID NAME RVM TCPU FCPU ACPU TMEM FMEM STAT

 0 ursa06                      1    800    797    700 8387584 4584448   on

</xterm>