XenCenter

Monitoring host and dom0 resources with SNMP

Note:

The SNMP feature is available for XenServer Premium or Trial Edition customers. For more information about XenServer licensing, see Licensing. To upgrade, or to buy a XenServer license, visit the XenServer website.

XenCenter YYYY.x.x is not yet supported for use with Citrix Hypervisor 8.2 CU1 in production environments. To manage your Citrix Hypervisor 8.2 CU1 production environment, use XenCenter 8.2.7.

You can install XenCenter 8.2.7 and XenCenter 2023.x.x on the same system. Installing XenCenter 2023.x.x does not overwrite your XenCenter 8.2.7 installation.

With the Pool Admin role, you can use SNMP to remotely monitor resources consumed by your XenServer host and dom0 - the control domain of your host. An SNMP manager, also known as a network management system (NMS), sends query requests to an SNMP agent running on a XenServer host. The SNMP agent replies to these query requests by sending data collected on various metrics back to the NMS. The data that can be collected is defined by object identifiers (OIDs) in a text file called a management information base (MIB). An OID represents a specific piece of measurable information about a network device, such as CPU or memory usage.

You can also configure traps, which are agent-initiated messages that alert the NMS that a specific event has occurred in XenServer. Both query requests and traps can be used to monitor the status of your XenServer pools. These are defined as metric and trap objects and are identified by OIDs in a MIB file XENSERVER-MIB.txt, available to download from the XenServer Downloads page. The following tables provide information about these metric and trap objects.

Metric objects

You can request a specific piece of information about your XenServer hosts by using the metrics listed in the following table. These metrics are used by the SNMP manager when sending query requests to an SNMP agent and so you can view this data in your NMS.

You can view the returned data from these metric objects from your NMS or from the xe CLI. To query the metric objects from the xe CLI, run host-data-source-query or vm-data-source-query and provide the RRDD data source as a value for the data-source parameter. For example:

xe host-data-source-query data-source=cpu_avg host=<host UUID>
<!--NeedCopy-->

Note:

By default, the NMS sends OID query requests to SNMP agents using port 161.

Object identifier (OID) RRDD data source Returned data Type
.1.3.6.1.4.1.60953.1.1.1.1 memory Dom0 total memory in MB Unsigned32
.1.3.6.1.4.1.60953.1.1.1.2 memory_internal_free Dom0 free memory in MB Unsigned32
.1.3.6.1.4.1.60953.1.1.1.3 cpu_usage Dom0 CPU usage as a percentage Float
.1.3.6.1.4.1.60953.1.1.1.4 memory_total_kib Host total memory in MB Unsigned32
.1.3.6.1.4.1.60953.1.1.1.5 memory_free_kib Host free memory in MB Unsigned32
.1.3.6.1.4.1.60953.1.1.1.6 cpu_avg Host CPU usage as a percentage Float
.1.3.6.1.4.1.60953.1.1.1.7 (see note 1) pCPUs number Unsigned32
.1.3.6.1.4.1.60953.1.1.1.8 running_vcpus Running vCPUs number Unsigned32
.1.3.6.1.4.1.60953.1.1.1.9 running_domains Running VMs number Unsigned32

Notes:

  1. The name of a pCPU is in the format cpu followed by a number. To query the number of pCPUs from the xe CLI, run the following command:

    xe host-data-source-list host=<host UUID> | grep -E 'cpu[0-9]+$'

    This returns a list of the CPU metrics that match the regular expression cpu[0-9]+.

Traps

Traps are alerts sent by the SNMP agent to notify the SNMP manager when certain events occur, allowing you to monitor your XenServer hosts and identify issues early. You can configure your SNMP settings to generate a trap when a limit is reached (for example, if the host CPU usage is too high). When a trap is generated, it is sent to your NMS and the following fields are returned as part of the trap object.

Note:

By default, the SNMP agent on the pool coordinator host sends traps to the NMS using UPD port 162.

Object identifier (OID) Field name Type Description
.1.3.6.1.4.1.60953.1.10.1.1 operation String Can be one of the following values: add or del. operation is add if a trap is generated by XenServer and sent to your NMS (an alert is also created in XenCenter) or del if an alert is destroyed (for example, if you dismiss an alert).
.1.3.6.1.4.1.60953.1.10.1.2 ref String The reference for the trap object.
.1.3.6.1.4.1.60953.1.10.1.3 uuid String The UUID of the trap object.
.1.3.6.1.4.1.60953.1.10.1.4 name String The name of the trap object.
.1.3.6.1.4.1.60953.1.10.1.5 priority Integer The severity of the trap. Can be one of the following values: 1: Critical, 2: Major, 3: Warning, 4: Minor, 5: Information, others: Unknown.
.1.3.6.1.4.1.60953.1.10.1.6 class String The category of the trap generated. Can be one of the following values: VM, Host, SR, Pool, VMPP, VMSS, PVS_proxy, VDI, or Certificate.
.1.3.6.1.4.1.60953.1.10.1.7 obj-uuid String The xapi object UUID of the various classes of the field class.
.1.3.6.1.4.1.60953.1.10.1.8 timestamp String The time at which the trap is generated.
.1.3.6.1.4.1.60953.1.10.1.9 body String Detailed information about the field name.

Prerequisites

  • All hosts in a pool must be running the same XenServer version and this version must contain the SNMP plugin.

    Note:

    If you cannot see the SNMP tab in XenCenter, it might be because the host or a member of the pool is not running a version of XenServer that supports SNMP. Update the host or pool to the latest version of XenServer.

  • The NMS you are using must support SNMPv2c or SNMPv3.

  • Your NMS and XenServer must be network-connected.

Constraints

  • You can configure SNMP settings for an entire pool or for a standalone host that is not part of a pool. Currently, you cannot configure SNMP settings for an individual host in a pool.
  • If you add a host to a pool that already has SNMP enabled and configured on it, XenCenter does not automatically apply the pool’s SNMP settings to the new host. You must reconfigure SNMP settings on the pool after adding the new host or configure the new host with the same SNMP settings before adding it to the pool.

    Note:

    When reconfiguring SNMP settings on a pool after adding a new host, ensure the host is up and running and not in maintenance mode.

  • If a host is removed from a pool with SNMP enabled and configured on it, XenCenter does not alter the SNMP settings on the host or the pool.

  • Before performing a rolling pool upgrade from Citrix Hypervisor 8.2 CU1 to XenServer 8 or applying updates to your XenServer hosts and pools, back up the following configuration files if you manually modified them before and need them:

    • /etc/snmp/snmpd.xs.conf
    • /etc/sysconfig/snmp
    • /var/lib/net-snmp/snmpd.conf
  • When the SNMP agent is offline, traps cannot be generated. For example, if the SNMP agent is restarted or the pool coordinator is rebooted or re-designated.

Configure SNMP by using XenCenter

You can configure SNMP for a standalone host or for an entire pool by using XenCenter or the xe CLI. For more information on how to configure SNMP by using the xe CLI, see Configure SNMP by using the xe CLI.

  1. Download the XENSERVER-MIB.txt file from the XenServer Downloads page and import it into your preferred NMS.
  2. In XenCenter, in the Infrastructure view, choose the host/pool that you want to configure SNMP settings for.
  3. In the General tab, click Properties.
  4. In the Properties dialog, select the SNMP tab.

    Note:

    When configuring SNMP for a pool, the SNMP tab displays the default SNMP configuration values for the entire pool. If you cannot see the SNMP tab in XenCenter, might be because the host or a member of the pool is not running a version of XenServer that supports SNMP. Update the host or pool to the latest version of XenServer.

  5. Select the Enable SNMP check box to enable SNMP.
  6. (Optional) Select the Support SNMPv3 check box to enable XenServer to use SNMPv3 in addition to SNMPv2c. By default, XenServer uses SNMPv2c.
  7. (Optional) To enable debug logging, select the Record debugging messages to syslog check box.
  8. Click OK to apply configuration changes to your host or pool.
  9. Configure your NMS by referring to your NMS documentation. Make sure that you specify the XenServer SNMP agent address (this is the IP address of the XenServer host or pool that you are monitoring).
  10. (Optional) To configure a trap receiver and begin receiving alerts for when a specific event has occurred in XenServer:
    • In your NMS, configure a trap receiver by referring to your NMS documentation.
    • On the SNMP tab, click Add Trap Receiver and specify the NMS Address, NMS Port, and the parameters of the SNMP version of the NMS supported.
    • To test the configuration, click Send Test Trap to send a test trap to your NMS.
    • To delete a trap receiver, click Delete Trap Receiver.
    • Click OK to apply your configuration changes.
Monitoring host and dom0 resources with SNMP