New Free Tool: Citrix Director Notification Service

DirectorNotificationCitrix Director for XenApp and XenDesktop can be a great utility for information about your Application / Desktop virtualisation environment. In Director you can find a wealth of information about the provisioned assets, the Controller, Licensing and Hypervisor status and the current running resources.

One area it’s always lacked is real time alerting. In order to really know what’s going on in your environment you need to be logged into director and watching. This is less than ideal and few monitoring vendors have endeavored to actually pull this data into their own solutions.

With the help of Rachel Berry, Prateek Kansal and Sridhar Mullapudi from Citrix. I set about diving into the logic and monitoring options within the FMA architecture. Citrix did a great job here and most if not all of it was readily available in PowerShell and oData. So, with the help of Citrix and a little bit of hard work, I’m very pleased to announce my latest free tool!

About the tool:

The Citrix Director Notification service sits on an edge server as a service (or local to the delivery controller) and periodically checks the health of:

  • Citrix Licensing.
  • Database Connections.
  • Broker Service.
  • Core Services.
  • Hypervisor Connections.

And if any of these items fall out of bounds, an SMTP alert is sent to the mailbox of your choice for action. The tool will also send “All Clear” emails when these items are resolved, ensuring you are aware when the service has resumed a healthy state, neat huh?

An example of one of these alarm emails can be seen below:

license

Hypervisor Alerts, too!

Did you know that the Citrix XenDesktop and XenApp 7.x suite also keep track of Hypervisor alarms? It was news to me! Any-who, if you are lucky enough to be running XenServer or vSphere. The director Notification service can be configured to also catch these alarms, allowing you to also be alerted.

An example of a Hypervisor alarm is below:

hypervisor alert

Installation guide:

Below you’ll find the steps to get the director notification service installed:

 Download:

Director Notification Service 1.0.5

Setup:
  • Download the Tool from the above URL.
  • Install the service on a server running Windows Server 2008 R2 or above with .Net Framework 4.
Provisioning the Account:

The service account maintains a WinRM remote session to your delivery controllers and performs checks on a frequency you determine. Setting up this account is the meat of the install.

  • Create an Active Directory Service account for monitoring director (this is needed later).
  • Copy the XDServiceAccountProvision.ps1 file from the installation directory and run this script on all delivery controllers to automatically create the correct permissions for your service account.
  • If you’re curious, read the script. A copy is below if you feel like doing it manually.
Using the configuration tool:

Config

You’ll find the configuration utility on the start menu, under Direct Notify Configuration (this tool requires admin permissions).

Once open, configure the tool to suit your environment:

config tool

Ensure to use the test buttons.

Once happy all is working. Start or restart the “Director Notification Service”.

service

Advanced Logging:

A debugging option exists in the configuration tool, this will log to a trace.log in the installation directory of the machine. If you have issues, first enable this and review the log.

Provisioning Script contents:

write-warning "Before proceeding, Ensure you have: "
write-warning "1: Created a service account for monitoring XenDesktop."
write-warning "2: Ensure you have local administrative access to the local machine."
write-warning "3: Ensure this powershell instance is elevated."
write-warning "4: Ensure you have Administrative access to the XenDesktop site."
read-host "Press Any Key To Continue"

asnp citrix* -ea 0

$domain=Read-Host -Prompt "enter domain name the monitoring user is a member of: e.g. lab"
$username=Read-Host -Prompt "enter monitoring user name: e.g. john.doe"
$group="Remote Management Users"

if(!(Get-AdminRole "Direct Notify Role")){
#create new administrative role
new-adminrole -Name "Direct Notify Role" -Description "used for Direct Notify Service"
Add-AdminPermission -Role "Direct Notify Role" -Permission Configuration_Read
Add-AdminPermission -Role "Direct Notify Role" -Permission Configuration_Write # needed for some unknown reason, thanks citrix ¯\_(ツ)_/¯
Add-AdminPermission -Role "Direct Notify Role" -Permission EnvTest
Add-AdminPermission -Role "Direct Notify Role" -Permission Global_Read
Add-AdminPermission -Role "Direct Notify Role" -Permission Hosts_Read
Add-AdminPermission -Role "Direct Notify Role" -Permission Licensing_Read

#create administrator
New-AdminAdministrator -Name $domain\$username
add-adminright -Administrator $domain\$username -Role "Direct Notify Role" -Scope all
}
#configure remote management if not configured
winrm quickconfig -quiet

#add the monitoring user to the remote management group
([ADSI]"WinNT://$env:computername/$Group,group").psbase.Invoke("Add",([ADSI]"WinNT://$domain/$username").path)

 Fine Print:

Just a few things to be aware of:

Application Dependencies:
  • The Notification service requires .Net 4.0
  • PowerShell Remoting must be enabled on the Broker Servers
  • A service account should be created to monitor the brokers (included in the script).
Tested on:
  • Citrix XenDesktop 7.6.
  • (Previous versions should work fine too.)

Support:

Drop me an email on andrew@andrewmorgan.ie if you have any trouble!

Enjoy and i hope this is very useful to you.

Future plans:

I’ll be diving into the oData values in the Citrix monitoring database in the next itteration. This work has already begun and will be updated soon.

Related Posts

While using the ShareFile mobile applications, NTF... Here's a weird little bug I caught in the wild while deploying XenMobile Enterprise. While browsing NTFS shares, published as connectors in the ShareF...
UnSticking an AppDisk provisioning task in XenDesk... Here's a wee little bug I've no idea how i created, but managed to clear it out anyway. After creating an AppDisk, it got a little stuck. I tried d...
Cannot Log into XenMobile 10.3 Appliance after ini... Here's a horrendous bug I just came across in the field today while deploying a XenMobile 10.3 Proof...

7 Comments About “New Free Tool: Citrix Director Notification Service

  1. Jamil

    Hi Andrew, thanks for the tool. Two observations:
    1- If there are more than one controller and the health check runs, it sends two email, 1 per controller. So if there are 4 controllers, then 4 emails get sent. It may make sense to just send one email with details of all controllers in it
    2- you may want to sent out for example Licensing Status when “Approaching the maximum number of licenses” is displayed in Director. I have tested this and I can see in Director the “Approaching the maximum number of licenses” warning is displayed but the tool rightly says it is healthy but would make sense to reflect the status of Director and the alert to match.

    Thanks

    Reply
  2. Pingback: Delivery Controller | Carl Stalhood

  3. Matt

    A great tool which fills an obvious void in Citrix products, they seem to get close but never deliver that final solution anymore :(.

    Would be even better Andrew if it could also send alerts for Machine failures, specific example would be “Maximum Load” for instance.

    Thanks

    Reply
  4. Pingback: Delivery Controller 7.7 | Cloud Evangelist

  5. Pingback: Delivery Controller 7.8 – Carl Stalhood

  6. Pingback: Delivery Controller 7.6.1000 / LTSR CU1 – Carl Stalhood

Leave a Reply