Xenserver
- Introduction
- Compatibility matrix
- Prerequisites
- Parameters
- Manual execution
- Discovery
- Agents generated by the plugin
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 hosts (Citrix calls the XenServers “hosts”, do not confuse VMs 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 specific host.
The information of these elements will be extracted through queries to the XenAPI and RRD queries. More information at https://pypi.org/project/XenAPI/.
The plugin will make the queries to extract the information, select the required information and 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 consultations.
Compatibility matrix
Environments where it has been tested | XenServer 6.2 |
Environments where it works | XenServer 6.2 o superior |
Systems where it has been tested | Rocky linux, Fedora 34 |
Systems where it works | Any linux system |
Prerequisites
- Machine with XenServer, with port 443/TCP open.
- Port 80/TCP (or the port where http connections occur) must be enabled
- Have the Pandora FMS Data Server enabled
- Have the Pandora FMS Plugin Server enabled
It is recommended that virtual machines have XenServer Tools installed, otherwise the information reported on the machines will be very limited.
Parameters
Parameters
|
Path to the plugin configuration file containing the configured parameters. |
|
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 XMLs for local transfer mode will be created (transfer_mode = local)>
[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 that you want to deactivate> = 1
[RENAME]
<name of the virtual machine, sr or host that you want to rename> = <name that you want to give it>
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
[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 generated agent modules will be set to “unknown” at times when 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 correct configuration of the configuration file, carefully review the previous chapter of this manual called "Parameters". All possible configuration options are detailed in it.
Normal execution
./pandora_xenserver -c <path file conf>
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/
Once loaded, XenServer environments can be monitored by creating Discovery tasks from the Management > Discovery > Applications section.
Once loaded, XenServer environments can be monitored by creating Discovery tasks from the Management > Discovery > Applications section.
For each task, the following minimum data will be requested:
- XenServer IP: IP of the XenServer server to monitor.
- XenServer user: Connection user to the XenServer.
- Password: Password of the connection user.
- Tentacle IP: IP of the Tentacle server to send agent data to. Normally this parameter will not be modified.
- Tentacle port: Tentacle server port to send data to. Normally this parameter will not be modified.
- Tentacle extra options: Additional options for sending data through the Tentacle client. Normally this parameter will not be modified.
You can also adjust the task configuration to customize the desired monitoring:
- Time adjustment: Time adjustment, enter in seconds.
- Scan VM IP: Activate to check the IP of the virtual machines.
- Scan all Hosts: Check to enable scanning of all hosts.
- Scan all VM: Check to enable scanning of all virtual machines.
- Scan all SR: Check to enable scanning of all SR agents.
- Extra settings: Optional additional configuration block. Here you can include all the plugin configuration parameters you want, such as the REJECT or RENAME blocks.
Tasks that are successfully completed will have an execution summary with the following information:
- Hosts: Number of monitored hosts.
- Storage: Amount of monitored storage.
- VMs: Number of virtual machines that are not templates or control domain. A control domain is a special virtual machine that acts as a management interface for the Xen environment.
- Hosts VMs running: Number of virtual machines running on the monitored hosts.
- Hosts VMs installed: Number of virtual machines on monitored hosts, including templates and control domains.
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)
https://pandorafms.com/guides/public/link/1013#bkmrk-agentes-del-tipo-sto
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 | Type | Unit |
physical_size | physical space | generic_data | GB |
physical_utilisation | physical_utilisation | generic_data | GB |
free space | free space | generic_data | GB |
used percent | percent SR percentage used | generic_data | % |
Virtual Machine (VM) type agents
Each agent will have the IP of the virtual machine and its system
operational (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 | Descripction | Type | Unit |
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>_size | VDI size | generic_data | GB |
VDI_<nombre vdi>_used | The percentage of physical space currently occupied by the disk image in the storage repository. Note that the utilization percentage on thick disks will always be 100%, since all space on the machine is reserved when the disk is created. | generic_data | % |
Vbd_XX_write | Write speed in bytes per second | generic_data | Bytes/sec |
Vbd_XX_read | Reading speed in bytes per second |
XenServer-type agents
For each host or server, an agent will be generated, 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 | Type | Unit |
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 | % |