This blog is an extension of the Automated Daily and weekly Report Email for Director blog, which illustrates how to get Director reports via email.

In this post, we will discuss how you can send custom reports as email in addition to built-in reports available in the Director Trends page.  For more information, read this blog, which shows you how to generate custom reports using Linqpad.

What does this tool do?

This tool allows customers to automatically receive recurring emails, containing custom reports built from data directly retrieved for the Monitoring database, in addition to the built-in Director Trend reports.

Prerequisites:

This tool is Compatible with Citrix Director 7.5 and higher

The Administrator configuring the tool should have XenDesktop Read-only admin privileges or higher. (Check troubleshooting section for more details).

Installation and Configuration

Download the tool from the link and install the tool on Citrix Director Server.

Click the “Configure” button and ensure the config.xml opens within notepad. By default this file contains the configuration for Trend reports with default timing set to 9:00 AM for daily reports and to Monday-9:00 AM for weekly reports. Modify this to the time you wish to run the scheduled report, save the file and close it.

Below is an example config.xml file with modified time of the both built-in and custom reports:

<? xml version=”1.0″ encoding=”UTF-8″?>

<Reports>

<Report>

<!—Director builtin reports –>

<ReportName>Director daily Reports</ReportName>

<Query type=”Default”>Load Evaluator Index</Query>

<DeliveryGroupName>All</DeliveryGroupName>

<Time recurrence=”daily”>10:35:00</Time>

<From>user@domain.com</From>

<RecipientEmail>user.domain@citrix.com</RecipientEmail>

<SMTPServer> mailserver.domain.com</SMTPServer>

<DirectorServer>localhost</DirectorServer>

<ReportType>PDF</ReportType>

</Report>

<Report>

<ReportName>Director Daily Reports</ReportName>

<Query type=”Default”>Load Evaluator Index</Query>

<DeliveryGroupName>All</DeliveryGroupName>

<Time recurrence=”weekly”>Monday-10:35:00</Time>

<From>user@domain.com</From>

<RecipientEmail>user@domain.com</RecipientEmail>

<SMTPServer>mail.domain.com</SMTPServer>

<DirectorServer>localhost</DirectorServer>

<ReportType>PDF</ReportType>

</Report>

<!—Custom Reports for linqpad –>

<Report>

<ReportName>LinqPad Report1</ReportName>

<Query type=”Default”>c:\users\public\Documents\linqQuries\Desktopusage.linq</Query>

<Time recurrence=”weekly”>Monday-10:35:00</Time>

<From>user@domain.com</From>

<RecipientEmail>user@domain.com</RecipientEmail>

<SMTPServer>mail.domain.com</SMTPServer>

<DirectorServer>localhost</DirectorServer>

</Report>

</Reports>

Node Definition:

Report Name:

Name of the report. This will be sent as the Subject of the email.

Query:

Director Trends Tab name under which the report will be mailed to recipients.

Different values for Query supported for Director 7.5 and Director 7.6 are:

  1. Sessions
  2. Failed Desktop OS Machines
  3. Connection Failures
  4. Failed Server OS Machines
  5. Logon Performance
  6. Load Evaluator Index

In Director 7.6 we added support for:

  1. Hosted Application Usage

For Custom Reports:

Provide complete path of the query (.linq) file saved using Linqpad.In the above tag we see desktop usage.linq file location. This linq file has the linq query that can be run on linqpad. The results are exported as CSV file and mailed to receptionist specified in To section of the node. We can lean more on how to write the custom report in the following blog.

Steps to add Custom reporting in email:

(1)   Follow the blog and create you custom query

(2)   Make sure query works fine on linqpad

(3)   Save the query in required folder

(4)   Provide the location of the .linq file in the Query node.

Note: Ensure that each node contains only one query. Also make sure to use the exact words as the query values are case sensitive.

DeliveryGroupName:

Name of the Delivery Group for which the report is exported.

Time:

This is when the report to be mailed. Recurrence can be daily or weekly. The format for daily is “HH:MM:SS” and weekly is “DayOfTheWeek-HH:MM:SS”

From:

Email address of the sender.

RecipientEmail:

To field in email. It can be single address, group or many with comma separated address.

SMTPServer:

SMTP Server from which email to be sent

DirectorServer:

Director Server IP Address or FQDN

In order to email more than one report at a time, you can add the desired number of nodes in the same format as shown above. After modifying the file, save it and close the notepad application. The service will automatically start and the configuration is complete. You will now receive the email on daily/weekly based on the new configuration. If there is any issue during installation or configuration, have a look at troubleshooting section in this blog.