Thursday, December 6, 2012

Monitoring and sending email alerts for Citrix XenApp 6.5 and XenDesktop 5.6 license server connectivity

I was told lately by a client that their Citrix environment have been having connectivity issues to the licensing server even though the licensing service does not appear to have stopped.  As there are no errors logged in the event logs, the quick solution is to restart the licensing service.  This hasn’t been much of a problem because of the 720 hours (30 day) grace period that the XenApp and XenDesktop services have until they stop servicing requests.  Since the licensing server is going to be moved to another server in the following weeks, we decided that we’ll simply monitor the events thrown and restart the services as required so this blog post serves to demonstrate what events are thrown when a XenApp 6.5 or XenDesktop 5.6 server logs when it loses contact with the licensing server and how to configure Windows Server 2008 R2 to automatically send an email alert to a email address.  Let’s begin by looking at the events logged on the XenApp and XenDesktop servers so we know what to actually monitor.

XenDesktop 5.6 Licensing Logs

The events logged in the application logs on a XenDesktop 5.6 DDC are:

Error
Event ID 1151

The Citrix Broker Service cannot contact the license server 'licensingServerName'.

Please ensure that the license server is functioning correctly and that the

details identifying the license server are correct in the XenDesktop configuration.

image

Warning
Event ID 1154

This controller has entered the licensing grace period.

You have 720 hour(s) remaining before this controller stops providing desktop sessions.

image

Event ID 1151 is logged first, then followed by 1154:

image

When the XenDesktop server re-establishes connectivity to the licensing server, the following events are logged into the system logs:

Information
Event ID 1150

The Citrix Broker Service successfully contacted the license server 'licensingServerName'.

image

Information
Event ID 1150

The Citrix Broker Service is successfully communicating with the license server 'licensingServerName'. This controller is no longer in the licensing grace period.

image

XenApp 6.5 Licensing Logs

The events logged in the system logs on a XenApp 6.5 servers are:

Error
Event ID 9018

Citrix XenApp cannot contact the license server licensingServerName.

image

Warning
Event ID 9015

Citrix XenApp has entered the grace period. You have 720 hour(s) remaining before this server stops accepting connections from client devices.

image

Event ID 9018 is logged first, then followed by 9015:

image

Additionally, the following Citrix License Warning Notice prompt is displayed when you log onto the XenApp server:

Citrix XenApp cannot contact the license server licensingServerName.

image

When the XenDesktop server re-establishes connectivity to the licensing server, the following events are logged into the system logs:

Information
Event ID 9019

The Citrix Broker Service successfully contacted the license server 'licensingServerName'.

image

Information
Event ID 9016

This server is successfully communicating with the license server. Citrix XenApp has left the grace period.

image

--------------------------------------------------------------------------------------------------------------------------------------------------------------------

Monitoring XenDesktop 5.6 Licensing Server Connectivity

Since there are 2 events logged when a XenDesktop DDC loses connectivity to the licensing server, you are free to choose which event to trigger an email alert.  My preference is to use the event ID 1151 error to trigger the alert so begin by opening up the Event Viewer, locate log in the Application log, right click on the item and click on Attach Task To This Event…:

image

Give the task a name and then click on Next:

Citrix XenDesktop cannot contact the license server

clip_image002

Note the event being logged and click Next:

clip_image002[4]

Select Send an e-mail and click on Next:

clip_image002[6]

Fill in the appropriate fields:

clip_image002[8]

Citrix XenDesktop (XenDesktopServerName) cannot contact the license server.  The server will be entering a licensing grace period now.

image

Review the settings, check the checkbox Open the Properties dialog for this task when I click Finish then click on the Finish button:

image

In the properties window of the alert, click on the Change User or Group… button to change the account that is going to be used to run this task (it defaults to the account you’re logged into):

image

Change the account to NT AUTHORITY\LOCAL SERVICE and click OK:

image

image

clip_image002[10]

Now that we have monitoring set up to send e-mail alerts when the XenDesktop DDC is unable to contact the licensing server, the next step is to set up an alert when it is able to contact licensing server again.  The event we’re going to monitor will be event ID 1156:

Complete the same steps as we did for the error (I won’t go into as much detail as the first example:

image

The Citrix Broker Service is successfully communicating with the license server

clip_image002[12]

clip_image002[14]

clip_image002[16]

The Citrix Broker Service on Citrix XenDesktop (XenDesktopServerName) is successfully communicating with the license server.  This controller is no longer in the licensing grace period.

image

image

image

image

An alert will now be sent when the XenDesktop DDC server loses connectivity to the licensing server and another alert will be sent when it re-establishes connection.

Monitoring XenApp 6.5 Licensing Server Connectivity

Since there are 2 events logged when a XenApp loses connectivity to the licensing server, you are free to choose which event to trigger an email alert. My preference is to use the event ID 9018 error to trigger the alert so begin by opening up the Event Viewer, locate the log in the System log, right click on the item and click on Attach Task To This Event…:

image

Give the task a name and then click on Next:

Citrix XenApp cannot contact the license server

clip_image002[28]

Note the event being logged and click Next:

clip_image002[30]

Select Send an e-mail and click on Next:

clip_image002[6]

Fill in the appropriate fields:

clip_image002[8]

Citrix XenDesktop (XenDesktopServerName) cannot contact the license server. The server will be entering a licensing grace period now.

image

Review the settings, check the checkbox Open the Properties dialog for this task when I click Finish then click on the Finish button:

image

In the properties window of the alert, click on the Change User or Group… button to change the account that is going to be used to run this task (it defaults to the account you’re logged into):

image

Change the account to NT AUTHORITY\LOCAL SERVICE and click OK:

image

image

clip_image002[32]

Now that we have monitoring set up to send e-mail alerts when the XenApp server is unable to contact the licensing server, the next step is to set up an alert when it is able to contact licensing server again. The event we’re going to monitor will be event ID 9016:

Complete the same steps as we did for the error (I won’t go into as much detail as the first example:

image

Citrix XenApp has successfully contacted the license server licensingServerName.

clip_image002[34]

clip_image002[36]

clip_image002[16]

The Citrix Broker Service on Citrix XenDesktop (XenDesktopServerName) is successfully communicating with the license server. This controller is no longer in the licensing grace period.

image

image

image

image

An alert will now be sent when the XenApp server loses connectivity to the licensing server and another alert will be sent when it re-establishes connection.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------

Note that if you would like to edit the properties of the alerts at a later time, you can find these alerts in Configuration –> Task Scheduler –> Task Scheduler Library –> Event Viewer Tasks:

image

Hope this helps anyone out there looking for a quick way to monitor licensing alerts with Windows Server 2008 R2 native alerts.

2 comments:

Email archiving software said...

Excellent tips, good for time saving.

Anonymous said...

Very helpful Terence.
Cheers