Monday, November 2, 2015

Citrix XenApp Server Monitoring Script / Citrix Server HealthCheck Script

I would like to share the Citrix XenApp Server Monitoring Script  / Citrix Server Health Check Script which is created by me with the bits and pieces of scripts which i found in Google and some useful blogs.
Being an administrator, you need to check the status of Citrix server. Logging into the server and checking the details is a hectic process. What if you could sit and relax and if any issues, you receive an email in your inbox. Wonderful!… Right?
The main advantage of this script is that you will get a beautiful report in your inbox which helps you to identify the issues in your Citrix Environment in short. It is easy to implement the script by non-scripting people too.

Why my script? For Better presentation and logging. Simple and understandable Email reporting.

What is the requirement?
1. Need to have the Power Shell V2 installed on one server [Prefer ZDC]. [Note: You may need to install the Power Shell on all your legacy servers if the script does not function as expected]
2. Need to have the XenApp Commands Tools / SDK Installed on this server.
3. Power Shell Remote Execution Policy to be enabled.
4. Make sure that you have any Power Shell Editors installed on this machine [PowerShell ISE, PowerGUI Script Editor, etc]

What you have to do?
1. Download the script from the site [If no download link available, email to ginsmon@live.com]
2. Copy the script into a directory on your ZDC / The server which you prefer.
3. Open the script with the Editors and fill the missing parameters based on your Customer Environment.
XenAppHealthCheckScript1
4. Once you complete with the required details, please save the script and execute the script using PowerShell.
5. Wait and watch what is going on… Hurray!… It is an awesome simple report in your mailbox or in the PowerShell console.

What are the advantages or what does this script checks?
1. You have not required to provide any server list or names. The script will automatically pulls the servers names from the Citrix Farm using ZDC.
2. It can easily adapt or implement on any Citrix XenApp 4.5 / 5 / 6 / 6.5 Environments with Windows 2003 / 2008.
3. The script checks the below parameters on the Citrix servers and report to you the status.
##   – Ping response of the Server.
##   – Citrix Logon setting status.
##   – ICA Active Sessions on the server.
##   – ICA Disconnected Sessions on the server.
##   – Citrix License Usage on the License Server.
##   – Assigned Load Evaluator to the Citrix server.
##   – Citrix Server Load.
##   – RDP port response.
##   – ICA port response which identifies the Listener down status also.
##   – CGP port response (session reliability).
##   – CPU Usage of the server.
##   – Memory Usage of the server.
##   – Citrix Related Services (IMA, Print Spooler, Citrix Print, WMI, XML).
##   – Server uptime (to ensure scheduled reboots are occurring).
##   – Server folder path and worker group memberships.
##   – Applications published on the server.

Here is the awaited Results… The wait time is over… Grab it at the earliest…

1. You can schedule to run this PowerShell script using the Scheduled Task if you want to run it periodically. If you are running the script manually, you will find the below screen in PowerShell console.
2. At the end of execution of the script, you will get the result as shown below in your PowerShell console.
XenAppHealthCheckScript2
3. You do not have time to login to the Server and check the Console result everytime and you need an email report. Below are the screenshot, how your email report looks like…
XenAppHealthCheckScript3
XenAppHealthCheckScript4

4. Also the email which you will receive has an attachment which contains the detailed log file for your detailed reference.
XenAppHealthCheckScript5

Hope i was able to contribute to reduce your human effort in checking the Health of the Citrix XenApp Servers.
If you find this script useful for you, please donate to assist you more :-)


CreditsJason Poyner [He is the real hero behind the HTML reporting codes]. Ref: http://deptive.co.nz/