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.
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.
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…
4. Also the email which you will receive has an attachment which contains the detailed log file for your detailed reference.
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 🙂
Credits: Jason Poyner [He is the real hero behind the HTML reporting codes]. Ref: http://deptive.co.nz/
Nice script and its very usefull, Moreover steps are very clear to understand everyone and enjoy the technologies.
Thanks vinay.
Very nice work need to learn lot from you 🙂
you are always welcome
Its a very useful tool which can be implemented in any Citrix farm . This helps Citrix administrators to be proactive in resolving issues.
Thanks Jeba.. Watch out the space for more 🙂
Simple and less effort. Thanks for the good work and chat support provided for making this script to work.
You are always welcome and hopefully i could give you more in the future too
Possible to include the Profile Management Service?
Yes, it is possible.
Dude… I was glad to see the script. . Which is neatly explained and segregated into functions. I scheduled this script after some tuning in my environment for every day. It is taking around 30 min to complete the report and send. Its been over a week and I am still thinking what is missing in this report :D.
Great work and wonderful job Gins. Proud of you boy.
Cons:
1. Not able get the image in the report.
2. Sometimes, different zone servers are reported as not ping able. No consistency in that. Not the same servers. When I ran report from server in 1 zone and issue is faced for other zones … not sure of it.
I will work towards your cons and need your help. I was not active some time and will try to be active. We will discuss and will help you offline.
Can you please add the provisioning service options? For the rest a great script!
Yes, i will add that as a separate one for the provisioned xenapp server health check :-). This is very generic to do a health check for the XenApp servers irrespective of physical or virtual or streamed
First of all, thanks a ton for this wonderful script and I’ve deployed this for multiple customers. However, I have something that I’m unable to sort it out. Everything on the report mail comes fine for all customers only the License part always shows “Citrix License Usage: Error; Check Detailed Logs”. So, need your help here to resolve this issue.
i will try to correct that bug at the earliest
Hi Ginsmon, Thanks a lot for this wonderful script. Have you found the fix to License issue ? We also getting the same.
I found the cause for the same. Working towards the fix. I could not focus last few months due to my personal reasons. I will try to make my blog active sooner.
Does this script work on Citrix Presentation Server 4.5?
Yes, it works. But your OS Platform should be Windows 2003 Ent. Also you need to install some minor components on all of the 4.5 farm servers
I have powershell v2 installed on the 2k3 servers.. Still the script doesn’t work on 4.5 environment.. However works great for 6.5.. License details are still missing.. Any help is greatly appreciated
Dear Rajeev,
I was offline due to busy professional challenges. My apologies for the late reply. Do you still run the same environment or you want to look into the current state now?
Regards,
Ginsmon
Why AvgCPU got error randomly ?
It is because the WMI query does not return the values correctly. Other possibilities i may need to troubleshoot at your environment level. Is all your servers are W2k8? Mostly i see this problem with W2k3 hosts only
Just wanted to say Great job on this script and keep up the good work. I hope to see something similar in the future that would check the health of the entire citrix stack…7.6 XA/XD, PVS, NS, and even XenMobile. That would be something I would gladly pay for.
I accept the challenge. Hopefully i can do it. Do you have test environment to test my scripts?
Ginsmon
let me know if you are building this I would be very intersted in testing with CTX 7.6
Cheers
Thomas Poppelgaard
CTP
Hi Thomas.. catch me offline to discuss on CTX 7.6. Email me ginsmon@live.com
My company is a citrix platinum partner and we have expert engineers in nearly anything citrix or related. We do have a test environment and I can guarantee many of our engineers would be happy to help you test. Hit me up offline and we can discuss.
I am starting my long vacation. I will be back to my blog actively from mid of Jan and looking forward working with you.
Not a problem. Grab my email address from my account info and we can setup a time to chat over the phone/email and discuss this when you get back.
How do I download this script. I am unable to download it.
are you not able to find the download link on my blog? I have provided the download link at the bottom of the same blog. If you still can not, give me your email id an i will provide you the script
You are Rock Star !! this was with me but not as consolidated as you presented here. Thank you so much and all the fame and accolade I will get by using this is truly yours !!
Hi Gins…I know u dnt need more comments of appreation from my end for this awsome work… coz U already had enough!!! 😉 … good to know that its moving arround well and gettting more features added to it as a result in parallel… keep us posted on your updates on the same and will defenitly reach you out offline…all the very best my dear mate…great go!!!
Hi Gins..I am sure u dnt need more comments of appretiation from my end on this great job coz u already had enough!!! 😉 Good to know that it goes well arround and thus getting more features added to it in result… I may need your help on some specific topics in it and in general…will reach you offline to have it…
I am sure ur dedication will defenitly keep this blog active… All the very best dear mate…Great goo..!!!
Hi Dear…I know you don’t actually need a comment of appreciation from my end on this wonderfull job…coz u had enough already…lol!!! Its gud to see it goes well arround n thus getting updates added to it in result…I may need your help on this stuff specifically on some topics n will reach u offline…keep up the gud work as always mate…you have my best wishes….gr8 goo…!!!
This is a wonderfulscript
I am unable to download the Script. Please share it my ID – dhillmohan@gmail.com
Also let me know what is the requirement for 4.5 farms.
Thanks in Advance
This would be very interesting for me, too!
What is to be done to make it work with a 4.5 farm?
You need to install the powershell on the server and install the xenapp remoting commands tools from citrix to work on a 4.5 farm. if not, we have a VBS script for the 4.5 farm
Thank you for answering, but I’ve already done it myself! Very nice script, though I’ve made some “customizing”…
Hi Ginsmon,
Thanks a lot for this wonderful script. i need your help and guidance to develop monitoring for Citrix XenApp 6.5 & 7.6.
Please let me know the email address to reach you for further discussion.
you can reach me at ginsmon@live.com. This script will work for XA 6.5. Script for 7.6 is in testing phase.
Please suggest, how to rerun a script post remediation… what if i have to run a report on failed or remediated servers…
As of now, the script is not intelligent to perform the same. However a new version of script which can read server names from text file for Health Check is in progress. That should help you to test only few servers with a manual input of the server names.
Any suggestion, to rerun a script for failed servers…. instead of running the entire script post remediation.
There is a script being tested to read server names from the text file and you can define the number of servers to be checked.
Hey Ginsmon,
i tried the script but i want to know how to make it dump a csv file to be like this,
server,ping,application,
srv1,success,success.
The complete HTML reporting code needs to be changed to write into an excel. But a lots of code change is required and it is possible.
Hi Joseph, first of all thank you for this script. It’s really appreciated the effort you have put into this. That being said, is there a possibility to have the available disk space show up in the table?
Joseph, first of all thank you for this wonderful script. One request I have is to see if it is possible to add available disk space per server? thanks in advance
Yes, it is possible and I will share the one soon
Joseph, any news on this new updated script?
Hi Joseph, did you get a chance to include Disk space parameter… waiting for the new script.
i am unable to download it, can you please mail me @ kushalreddy0108@gmail.com
I have mailed you the details
Hi Gins,This is Pandiyan (HP). Hopefully you could remember :). Do you have a script for Xendesktop 7.6?
Dear Pandiyan,
Yes, I do have the script for 7.6
Regards,
Ginsmon