---
title: "How to monitor a Citrix XenServer Cluster"
description: "Agentless monitoring of Citrix XenServer clusters uses the XEN API to check hosts and VMs. The setup involves adding commands and services in OP5 Monitor and configuring user access to the XenServer hosts."
url: "https://docs.itrsgroup.com/docs/faq/op5/360020055694-op5-monitor-how-to-monitor-a-citrix-xenserver-cluster/index.html"
---
**Note:** *check\_xenapi* is not supported on OP5 Monitor 9 and later. This guide was written for OP5 Monitor version 8.

This article describes 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 specific parameters:**

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

**Host specific **parameters**:**

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

**VM specific **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, add also 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** | **check\_command\_args** |
| 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** | **check\_command\_args** |
| 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** | **check\_command\_args** |
| 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.

![OP5 Monitor - How to monitor a Citrix XenServer Cluster](https://docscdn.itrsgroup.com/faq/images/op5/360020055694-688592-monitor_check_citrix_xen_in_op5_monitor.png)

## Remarks

This plugin is still under development. More checks will be added. Please send your feedback on [OP5 users mailing list.](http://www.op5.com/support/knowledge-base/mailing-list/ "op5 user mailinglist")

All checks have been tested on Citrix XenServer cluster v5.5 and 6.0.


