Citrix XenDesktop Monitor Service – What is available?

August 27, 2013

How To

XenDesktop 7 Monitor Service – What Data is Available?

In this post, I’ll go over what data can be retrieved using the Monitor Service, a quick overview of what the URL’s are and some examples of basic data access using a browser.

The Monitor Service OData API includes quite a bit of data. Most of it falls under the category of XenDesktop Session information (including usage and errors). These are tracked historically and the length of time the data is kept is based on both licensing and user configuration. These settings can be changed with the set-monitorconfiguration cmdlet. Please note – changing these settings should be done very carefully as you might end up with missing data in Director.

Using OData in a Web Browser

When developing these API’s – we discovered that a web browser is initially the easiest way to view the output of the query. In order to actually work with the data, you’ll quickly want move to something else like Microsoft Excel PowerPivot, LinqPad or programmatic access.

Chrome has an extension called the Advanced REST Client that we found useful. If you choose to view these URL’s in Internet Explorer, you should make sure to disable Feed reading view. This can be changed in Internet Options -> Content -> Feeds and Web Slices -> Settings. Once in that dialog, uncheck the Turn on feed reading view checkbox and once you save those settings by clicking OK, you’ll need to restart IE.

The documentation describes how to access the URL’s a few different ways here: http://support.citrix.com/proddocs/topic/xendesktop-7/cds-ms-odata-example.html

Discovering OData API’s

The Monitor Service exposes two main API’s for retrieving data. In all examples below, please replace localhost with the name of the XenDesktop Controller you are querying (if you are not on the machine itself). These API”s also require a XenDesktop Administrator to successfully retrieve data so you might be prompted for a username/password.

The $metadata url should be used to discover what is available. This is a very important document because it not only describes what is available from the URL, but it also can be used by programs that know how to read the OData syntax and allows them to programmatically generate client code that can be used to query the API’s. You can read more on the OData.org website describing the metadata format here: http://www.odata.org/documentation/odata-v2-documentation/overview/#3_Metadata_for_OData_Services.

Documentation of available methods to access these endpoints is here: http://support.citrix.com/proddocs/topic/xendesktop-7/cds-ms-odata-methods.html

Method API

This API is primarily used by Director for retrieving the historical chart data displayed.

Data API

This API is far more flexible and provides access to all of the data that is collected by the Monitor Service. The documentation includes a schema diagram which I’ve included below. The lines between the boxes are also very useful in understanding which relationships the objects have.

Our goal in the naming was to make most of the objects self-explanatory. A basic description of each object is here:

System information tables

  • DesktopGroup – Matches the Delivery Groups in Studio
  • Catalog – These are Machine Catalogs in Studio
  • Machine – These are the machines added to a Delivery Group in Studio
  • Hypervisor – If a machine is hypervisor managed, very basic hypervisor information is stored in this table
  • User – These are the users who have launched sessions – they are added as new sessions are created, so if a user never used XenDesktop, their information will not be in this table.

Session usage tables

A few example of queries you can run in a web browser follow:

http://blogs.citrix.com/2013/08/27/xendesktop-7-monitor-service-what-data-is-available/

Subscribe

Subscribe to our RSS feed and social profiles to receive updates.

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: