3.8 Sessions

Use the XenDesktop_Sessions Knowledge Script to monitor the status and number of sessions that exist on a XenDesktop or XenApp server on a total and per-server basis.

You can filter the number of servers to monitor by matching tags or metadata, and you can also filter the sessions by session states. You can also collect data on the maximum and average number of sessions on XenDesktop or XenApp servers, and total number of sessions on all XenDesktop or XenApp servers.

You can run this script on server catalogs or delivery groups. In many cases, a server belongs to both a catalog and a delivery group. If a server appears in a delivery group, it will be a member of a catalog as well. If a threshold event is raised for a server, and that server exists in both a catalog and a delivery group being monitored, the script raises two events: one event on the delivery group and one event on the catalog. As a result, some events might be duplicated. To avoid duplicate events, run the job only on delivery groups or only on catalogs, instead of on both objects.

3.8.1 Resource Objects

Citrix XenDesktop or XenApp Delivery Group object or Catalog object

3.8.2 Default Schedule

The default schedule is every 15 minutes.

3.8.3 Setting Parameter Values

Set the following parameters on the Values tab as needed:

Description

How to Set It

General Settings

Job failure event notification

Event severity when job fails

Set the severity level, from 1 to 40, to indicate the importance of an event in which the Sessions job fails. The default is 5.

Monitor Machine Sessions

Machine Filters

Include only machines with matching tags or metadata?

Select Yes to filter the list of sessions to monitor based on machines with matching tags (name) or metadata (name=value). The default is unselected.

In XenDesktop or XenApp you can associate tags and metadata with specific servers. A tag is simply a name, while a metadata item consists of a name and a value that you can specify in the following manner:

tag1, tag2,md1name=md1value , tag3, md1name = md2value, md2name =md2value

The script ignores and spaces around the commas and equal signs in the metadata item. Also, in this example the metadata name md1name is used twice, with two different values. This combination is valid, and it matches all sessions whose associated machines have either value for that metadata name. The script ignores duplicate entries for tags and metadata where both the name and value are duplicated.

Tips

  • If you specify only tags, the script monitors sessions associated only with a server that has any of those tags.

  • If you specify only metadata items, the script only monitors sessions associated with servers that have a matching metadata item (name and value).

  • If you specify both tags and metadata, the script monitors only sessions associated with servers that match at least one of the tags, and the script will also monitor at least one of the metadata items. In other words, the script monitors only sessions associated with machines that have a matching tag and a matching metadata item.

List of machines by tag (name) or metadata (name=value) to monitor

Specify the XenDesktop or XenApp servers that you want to monitor, based on tag (name) or metadata (name=value). Separate the server names with commas.

Include only machines in the following states?

Select Yes to filter the list of sessions to monitor based on one or more of the following set of session states. The default is Yes.

PreparingSession

Select Yes to filter the list of sessions to include sessions with the PreparingSession tag or metadata. The default is Yes.

Connected

Select Yes to filter the list of sessions to include sessions with the Connected tag or metadata. The default is Yes.

Active

Select Yes to filter the list of sessions to include sessions with the Active tag or metadata. The default is Yes.

Disconnected

Select Yes to filter the list of sessions to include sessions with the Disconnected tag or metadata. The default is Yes.

Reconnecting

Select Yes to filter the list of sessions to include sessions with the Reconnecting tag or metadata. The default is Yes.

NonBrokeredSession

Select Yes to filter the list of sessions to include sessions with the NonBrokeredSession tag or metadata. The default is Yes.

Unknown

Select Yes to filter the list of sessions to include sessions with the Unknown tag or metadata. The default is Yes.

Other

Select Yes to filter the list of sessions to include sessions with the Other tag or metadata. The default is Yes.

Monitor Sessions Per Machine

Event Notification

Raise event if number of sessions on any machine exceeds threshold?

Select Yes to raise an event when the number of sessions on any XenDesktop or XenApp server exceeds a threshold you set. The default is Yes.

Threshold - Maximum number of sessions on any machine

Specify the maximum number of sessions that can exist on any machine before an event is raised. The default is 10 sessions.

Event severity when services are not running

Set the event severity level, from 1 to 40, to indicate the importance of the event in which the XenDesktop or XenApp services are not running. The default is 10.

Data Collection

Collect data for maximum number of sessions on any machine?

Select Yes to collect data for the maximum number of sessions on any XenDesktop or XenApp server. The default is unselected.

Collect data for average number of sessions per machine?

Select Yes to collect data for the average number of sessions per XenDesktop or XenApp server. The default is unselected.

Monitor Total Number of Sessions

Event Notification

Raise event if total number of sessions exceeds threshold?

Select Yes to raise an event when the total number of sessions exceeds a threshold you set. The default is Yes.

Threshold - Maximum number of sessions

Specify the maximum number of sessions that can exist on all XenDesktop or XenApp servers before an event is raised. The default is 75 sessions.

Event severity when number of sessions exceeds threshold

Set the event severity level, from 1 to 40, to indicate the importance of the event in number of sessions exceeds the threshold. The default is 10.

Data Collection

Collect data for total number of sessions?

Select Yes to collect data for the total number of sessions on a XenDesktop or XenApp server. The default is unselected.