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.
Monitor Concurrent license usage. How can I monitor and report the Concurrent license.
What if you could sit and relax and if any issues, you receive an email in your inbox. 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?
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.
Power Shell Remote Execution Policy to be enabled. Make sure that you have any Power Shell Editors installed on this machine [PowerShell ISE, PowerGUI Script Editor, etc] What you have to do? Download the script from the site [If no download link available, email to firstname.lastname@example.org] 2. Copy the script into a directory on your ZDC / The server which you prefer. Open the script with the Editors and fill the missing parameters based on your Customer Environment.
Once you complete with the required details, please save the script and execute the script using PowerShell. 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? 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. It can easily adapt or implement on any Citrix XenApp 4.5 / 5 / 6 / 6.5 Environments with Windows 2003 / 2008. 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. At the end of execution of the script, you will get the result as shown below in your PowerShell console.
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]. 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. Not able get the image in the report. 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 had a request today to track application launches on an old Presentation Server 4.0 farm so we could get a good picture of application utilization and figure out what apps needed to be migrated to newer XenApp farms and what could be decommissioned. EdgeSight has an excellent “Published Application Launch Summary” report but it it needs the EdgeSight agent to be installed in “Advanced” mode to work. This requires a Platinum license and just my luck, this particular farm had an Enterprise license and all the EdgeSight agents had to be installed in “Basic” mode. So no launch data for me. ÐŸ™ x81 So my solution was to write a quick.vbs logon script to write each app launch to a.txt file on a file share we could monitor.
Each launch would append the.txt file. Yeah, it’s a poor man’s Edgesight application launch report but it works in a pinch. Grabbing environmental variables for each session launch was easy, the tough part was grabbing the name of the Citrix application that was launched. For this I turn to Warren Simondson/Ctrl-Alt-Del IT Consultancy and their Getpubapp.exe utility: This handy little tool will let you query what app is running in an ICA session. I had to write my script to run the executable first, store the result in a variable, combine it with my environmental variables, and then finally append the output to my text file. Download Getpubapp.exe and stick it in a file share where all users will have permissions to write to.
Create an empty.txt file called PS4launches.txt. If the code runs off the page above just select all or just copy and paste the script from this.txt file (right click – save as): This is a quick and dirty script I figured out and wrote in just a few hours so if you add any cool modifications, please comment below. My output has some key pieces of criteria I was after which were: -Date -Time -Citrix Application Name -Domain/UserID -Citrix server name -Session ID -Client name Now it’s just a simple matter of creating a group policy and setting this as a user logon script.
I keep the “Session ID” in the output so I can tell the difference between an ICA session and an RDP session initiated by an administrator. My txt file output looks like this: You’ll notice on the last line is was an RDP session by an administrator logging into the server so there is no published app name. You just get an extra space.
If you want to work with the data, import the text file into Excel and use Text to Columns and use the spaces as deliminators. Then you can sort on any column you need. Jason Samuel is an Infrastructure Architect in Houston, TX with a primary focus on mobility, virtualization, and cloud technologies from Citrix, Microsoft, & VMware.
He also has an extensive background in web architecture and information security. He is certified in several technologies and is 1 of 50 people globally that is a recipient of the prestigious (CTP) award. He is 1 of 28 people in the world that is an (ACE). He is a featured author on which provides the latest IT Community News on Cloud, Data Center, Desktop, Mobility, Security, Storage, & Virtualization.
In his spare time Jason enjoys writing how-to articles and evangelizing the technologies he works with.
Disclaimer The sample scripts are not supported under any Microsoft standard support program or service. The sample scripts are provided AS IS without warranty of any kind. Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample scripts and documentation remains with you.
In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample scripts or documentation, even if Microsoft has been advised of the possibility of such damages.