Xenserver

This document describes the Xenserver functionality of PandoraFMS discovery.

Introduction

This document aims to describe the monitoring of XenServer servers with Pandora FMS. Based on our experience in system monitoring, a series of parameters have been chosen to be monitored by default; later modifications can be made according to the needs of each client.

To broadly describe the XenServer architecture we can talk about three elements:

● The XenServers or host (Citrix calls the XenServers “hosts”, not to confuse VM with hosts).
● The virtual machines or VMs that will be installed on a given host.
● The Storage Repositories or SRs that will also be associated with a given host.

The information of these elements will be extracted by queries to the XenAPI and RRD queries. More information in

 https://pypi.org/project/XenAPI/.

image-1683797512042.png


The plugin will make the queries to extract the information, it will select the required information and it will generate an XML document for each VM, for each host and for each SR. Each XML will contain the data of the parameters that we have decided to monitor for each element. These xml will be sent by Tentacle to Pandora server. Once these xml arrive at the server, in the web console we will see how a new agent is generated for each xml, and how in these agents a module is generated for each parameter that we are monitoring.

On the XenServer, port 443/TCP must be enabled so that API queries can be made. In addition, port 80/TCP (or the port through which http connections occur) must be enabled, so that the
DRR inquiries.

Compatibility matrix

Systems where it has been tested XenServer 6.2 or higher works
Environments where it works XenServer 6.2 or higher works

Systems where it has been tested Rocky linux, Fedora 34
Systems where it works Any linux system

Prerrequisites

It is recommended that virtual machines have XenServer Tools installed, otherwise the information reported on the machines will be very limited.

Parameters

Parameters

  • -c <path_file_conf> o --conf <path_file_conf>
Path to the plugin configuration file containing the configured parameters.
  • --as_discovery_plugin <1|0>
Run the plugin in discovery mode, it will show information about the execution, such as the number of machines.

In the configuration file (.conf) we will indicate the following parameters:

[CONF]
xen_server_ip = <server_ip>
user = <user>
password = <password>
temporary = <temporary files directory>

[PANDORA]
group = <group in which the agents will be placed>
logfile = <path of the log file created by the plugin>
interval = <interval in seconds at which plugin agents are created>
transfer_mode = <execution mode, the two possible options are local or tentacle>
tentacle_ip = <ip of tentacle, enter that of the Pandora machine in which you want to view the agents>
tentacle_client = <tentacle_client system command, default is tentacle_client>
tentacle_port = <tentacle port, default is 41121>
tentacle_opts = <additional options for transferring files to the indicated Tentacle server>
data_dir = <path of the folder where the agent XML will be created for local transfer mode (transfer_mode = local)>
id_as_name = < 1 if you want to use the SR id as the name of the SR agents (the alias will remain the name of the SR).)

[TUNING]
time_adjustment = <Time adjustment, enter in seconds>
scan_vm_ip = <Enable with 1 to check the virtual machine IP>
scan_all_vm = <Enable with 1 to enable scanning of all virtual machines>
scan_all_sr = <Enable with 1 to enable scanning of all SR agents>
scan_all_hosts = <Enable with 1 to enable scanning of all hosts>

[REJECT]
<name of the virtual machine, sr or host you want to disable> = 1

[RENAME ME]
<name of the virtual machine, sr or host that you want to rename> = <name that you want to put>

An example configuration file:

[CONF]
xen_server_ip=192.168.80.17
user=root
password=S4ToBh!
temporal=/tmp

[PANDORA]
group=Unknown
logfile=/tmp/pandora_xenserver.log
interval=300
transfer_mode=tentacle
tentacle_ip=172.42.42.101
tentacle_client=tentacle_client
tentacle_port=41121
tentacle_opts=
data_dir=/tmp/data_in
id_as_name = 1 

[TUNNING]
time_adjustment=10
scan_vm_ip=1
scan_all_vm=1
scan_all_sr=1
scan_all_host=1

[REJECT]
vm_test_env=1
sr_additional=1

[RENAME]
vm_env_prod_157=Prod157
vm_env_dev_157=Dev157

It must be taken into account that the interval that we define in this configuration file, which will be the interval of the agents that are generated when the plugin is executed, has to be equal to the execution interval of the plugin. If this is not the case, the modules of the generated agents will be set to "unknown" in the moments in which the agents try to collect the data but the plugin has not yet been executed.



Manual execution

The plugin can be run manually by terminal to check its correct configuration before its subsequent installation in PandoraFMS. This has two parameters, -c or --conf (you can use whichever you prefer) to call the configuration conf file.

For a correct configuration of the configuration file, carefully review the previous chapter of this manual called "Parameters". In it, all the possible configuration options are detailed.

Manual execution

./pandora_xenserver -c <path conf file>

An example output would be the following:

<module>
<name><![CDDATA[XenServer Plugin]]></name>
<type><![CDTADA[async_string]]></type>
<description><!CDDATA[Result of XenServer Plugin execution]]></description>
<data><![CDATA[OK]]></data>
</module>

As discovery plugin

./pandora_xenserver -c <ruta al archivo conf de configuración> --as_discovery_plugin 1 

An example output would be the following:

[{"summary":{"Hosts":1,"Storage":7, "VMs":23,"Hosts VMs running":10,"Hosts VMs installed":95}}]

Discovery

This plugin can be integrated with Pandora FMS Discovery.

To do this, you must load the ".disco" package that you can download from the Pandora FMS library:

https://pandorafms.com/library/

image-1687944638257.png

Once loaded, XenServer environments can be monitored by creating Discovery tasks from the Management > Discovery > Applications section.

image-1687944787532.png

For each task, the following minimum data will be requested:

image.png

Task settings can also be adjusted to customize the desired monitoring:

image-1683798608834.png

Tasks that are successfully completed will have an execution summary with the following information:

image-1684313757448.png

The tasks that are not completed successfully will have an execution summary recording the errors produced.

Agents generated by the plugin

The plugin generates three types of agents:

● virtual machine (VM)
● storage disk (SR)
● XenServer (Host)

Storage Repository (SR) type agents

For each SR an agent will be generated, which will have a name of the type: XenSR_<name_of_SR>

SR Agent Modules
For each agent of this type the following modules will be generated:

Name Description Data type Unity
physical_size Physical space generic_data GB
physical_utilisation Physical use generic_data GB
free space Free space generic_data GB
used percent Percentage of SR used generic_data %

Virtual Machine (VM) type agents

Each agent will have the IP of the virtual machine and its system
operating (as long as you have XenServer Tools installed

VM Agent Modules

For each agent of this type the following modules will be generated:

Module name Description Data type Unity
Status Returns whether a VM is
running or not
generic_proc -
Status description state name generic_data_string -
Memory used RAM percentage
used
generic_data %
cpuX CPU load percentage generic_data %
Xenxerver Tools Check if the VM has been
installed and update XenServer
tools
generic_proc -
VDI_<nombre vdi> VDI size generic_data GB
Vbd_XX_write Write speed in bytes
per second
generic_data Bytes/sec
Vbd_XX_read Reading speed in bytes
per second
generic_data Bytes/sec

XenServer-type agents

An agent will be generated for each host or server, which will have a name of the type:

<XenServer_name>​

Each agent will recognize your IP.

XenServer Agent Modules

For each agent of this type the following modules will be generated:

Module name description data type unity
VMs running Number of VMs running generic_data -
VMs installed Number of VMs installed generic_data -
Memory used RAM percentage
used
generic_data %
Load CPU avg Average load percentage
CPU
generic_data %