How to monitor a Citrix XenServer Cluster

The purpose of this article is to describe how-to set up agentless monitoring of a Citrix XenServer using op5 Monitor. The plugin uses the XEN API to communicate with the XenServer so no changes to the server has to be made.

Through the plugin we can check the following parameters on the host and virtual servers running in the XEN environment.

Session Parameters:

  • list hosts
  • pool(s) state
  • VMs state

Host Parameters:

  • cpu (total, per core)
  • memory
  • disk I/O
  • network I/O
  • VM(s) running on this host
  • time difference

VM Parameters:

  • cpu (total, core)
  • memory(allocated, ballooned, internal)
  • disk I/O
  • network I/O
 

Prerequisites

  • Make sure you have the latest op5 plugin package installed. To verify this simply do a "yum update" when logged in to op5 Monitor via SSH.
  • Create a common user on your hosts. It will be used by the plugin to communicate with the XEN API on your hosts.
  • Add the master host in your cluster environment to op5 Monitor. All checks in this how-to will ask the master host.
    Note: If you need to monitor VMs that is not running on the master host, also add the host that the VM is running on to the op5 Monitor and add the VM checks to that host.
  • Host address in op5 Monitor must be the IP of the server.
 

Check commands

Add the required check commands in your configuration ('Configure' -> 'Commands' -> 'Add new command' -> 'Go').

Commands for the Cluster

COMMAND NAME COMMAND LINE
check_xenapi_list_host $USER1$/check_xenapi.pl -S $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -l listhost
check_xenapi_list_pool $USER1$/check_xenapi.pl -S $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -l listpool
check_xenapi_list_vms $USER1$/check_xenapi.pl -S $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -l list
 

Commands for the hosts

COMMAND NAME COMMAND LINE
check_xenapi_host_cpu $USER1$/check_xenapi.pl -S $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -H $ARG3$ -l cpu -w $ARG4$ -c $ARG5$
check_xenapi_host_cpu_core $USER1$/check_xenapi.pl -S $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -H $ARG3$ -l cpu -s $ARG4$ -w $ARG5$ -c $ARG6$
check_xenapi_host_io $USER1$/check_xenapi.pl -S $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -H $ARG3$ -l io
check_xenapi_host_mem $USER1$/check_xenapi.pl -S $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -H $ARG3$ -l mem -w $ARG4$ -c $ARG5$
check_xenapi_host_net $USER1$/check_xenapi.pl -S $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -H $ARG3$ -l net
check_xenapi_host_time $USER1$/check_xenapi.pl -S $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -H $ARG3$ -l time -s $ARG4$
 

Commands for the VMs

COMMAND NAME COMMAND LINE
check_xenapi_vm_cpu $USER1$/check_xenapi.pl -S $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -N $ARG3$ -l cpu -w $ARG4$ -c $ARG5$
check_xenapi_vm_io $USER1$/check_xenapi.pl -S $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -N $ARG3$ -l io
check_xenapi_vm_mem $USER1$/check_xenapi.pl -S $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -N $ARG3$ -l mem -w $ARG4$ -c $ARG5$
check_xenapi_vm_mem_ballooned $USER1$/check_xenapi.pl -S $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -N $ARG3$ -l mem -s ballooned -w $ARG4$ -c $ARG5$
check_xenapi_vm_net $USER1$/check_xenapi.pl -S $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -N $ARG3$ -l net

Note:

  • It is possible to use the VMs UUID instead of the name (short hostname). Add "-U" after "-N $ARG1$" and use the UUID as ARG1, ie. " -N 9789ff86-c909-36a1-0d3d-149fd18c0898 -U"
  • For more commands options and details, look at the plugin help.

Adding the services

Add the required services that you need, ('Configure' -> 'Host: ' -> 'Go' -> 'Services for host ' -> 'Add new service' -> 'Go'):

Please note that these arguments are just examples, you need to adjust them to suite your environment.

Services for cluster, global

SERVICE DESCRIPTION CHECK COMMAND ARGUMENTS
host list  check_xenapi_list_host username!password
host pool  check_xenapi_list pool username!password
VMs list  check_xenapi_list_vms username!password

Services for the hosts

SERVICE DESCRIPTION CHECK COMMAND ARGUMENTS
host1 cpu check_xenapi_host_cpu username!password!host1!80!90
host1 core 0 check_xenapi_host_cpu_core username!password!host1!0!80!90
host1 disk io check_xenapi_host_io username!passwordr!host1
host1 mem total check_xenapi_host_mem username!password!host1!85!95
host1 net check_xenapi_host_net username!password!host1
host1 time dif check_xenapi_host_time username!password!host1!time

Services for VMs

SERVICE DESCRIPTION CHECK COMMAND ARGUMENTS
vm1 cpu check_xenapi_vm_cpu username!password!vm1!80!90
vm1 disk io check_xenapi_vm_io username!password!vm1
vm1 mem total check_xenapi_vm_mem username!password!vm1!85!95
vm1 mem ballooned check_xenapi_vm_mem_ballooned username!password!vm1!ballooned!80!90
vm1 net check_xenapi_vm_net username!password!vm1

Save your configuration.

Here is an example of how these checks will look like in production.

 

Remarks All checks have been tested on Citrix XenServer cluster v5.5 and 6.0. You can see this plugin in use on our demo site.