This post has already been read 10601 times!
A while ago I wrote some monitoring software to get a high level view of whats happening on your Citrix XenApp 6.5 Estate. Details of this can be found here:
I have had loads of requests to update this to support XenDesktop 7.x and to be honest its something I have wanted to do for quite some time but have just not got round to it. This post will offer the first cut in my new monitoring “dashboard”
Just to be clear, this is NOT meant to replace existing monitoring software from vendors like ControlUp etc as the monitoring and specific detail around the Citrix stack they offer is far beyond what I am trying to achieve with this. It IS however meant to be a supplementary piece of monitoring that can be run and used for free and displayed without a login on a large monitoring wallboard or something like that.
The idea is to give you a high level snapshot of the estate when you walk into your workplace.
- The script is written in Powershell and I want to cover more than just the worker servers in this edition – more on that later
- I am NOT a Powershell expert and don’t claim to be. Therefore the code may not be optimised or written to best practice but It should do what it says on the tin and monitor the high level status of your critical Citrix XenDesktop Infrastructure.
- The XenServer Tests use the XenServer SDK – Make sure that this is downloaded and installed before you attempt to test your XenServers. The SDK can be found here
- The Graph used Google Charts so your Web Server that displays the output web page will need internet connectivity
- This IS a community project and is FREE. If you see this being offered at a cost then please let me know. Also – if you want to help, let me know. I already have my first fellow CTP offering to help – Thanks @msandbu
What I want to cover (eventually)
Once this is finished I want to be able to monitor the below. You may ask why release it early? The reason is it will give me the kick in the butt to finish this as it will be “out there”
- Citrix Licensing – Server Status and Vendor Daemon Port Test
- XenServer – Pool and Host Status and Management Port
- StoreFront – Server Status, Protocol Port and Receiver For Web Response Code
- NetScaler – Appliance Status and vServer Status (Up, Down, Degraded)
- Provisioning Services (TBA)
- Citrix Director (TBA)
- Citrix Brokers (TBA)
- Citrix Ticketing (TBA)
- XenDesktop Session Based Hosts (TBA)
- XenDesktop Desktop VDA’s (TBA)
- NetScaler – Unified Gateway, Content Switching, GSLB Service Status (TBA)
- XenServer – VM Status, Storage Status (TBA)
- Hypervisors – Include Nutanix, VMware and HyperV
So, as you can see there is quite a bit I want to get covered and it will take some time to get written. Like I said, If you want to help drop me an e-mail on firstname.lastname@example.org and I will get you involved. The structure of the files is done in suck a way that it will be easy to collaborate!
What Does It Look Like?
I have built in the ability to customise the web page within reason, but more about this later in the post. The reason for using a bar chart as opposed to a donut chart this time is that it gives the ability to scale out the monitoring areas without having to re-write the web generating code.
How Does It Work?
Like I said earlier, it is all Powershell driven. To get it up and running is pretty straight forward. You just get the scripts and registry file, set up the required directory structure and registry values and trigger the main PS1 file using a scheduled task as often as you want the monitor to run.
Installing The Software
First, you will need to monitoring server to run the script from. You can use one of your StoreFront Servers for this if you require or build a new one, will leave that up to you. In my lab I am running this from my Domain Controller.
NOTE: If you want to monitor XenServer you will need to install the XenServer SDK as mentioned earlier.
Set Up The Registry
E-mail me and request the link to the monitoring files. Extract the files and import the monitoring_registry.reg file into the registry of your monitoring server.
It will create all the values for this version of the script under a key “HKLM\Software\bretty.me.uk\monitoring”
As you will see below there are quite a few values in there, I will run through what all of them are used for.
- CitrixLogo – File name for the Citrix Logo Displayed in the upper left hand part of the web page (needs to be in the same location as the outputted web page)
- ColumnBad – RGB Code for showing services as down (Include the #)
- ColumnGood – RGB Code for showing services as up (Include the #)
- CompanyLogo – File name for your company logo – displayed in the upper right of the web page (needs to be in the same location as the outputted web page)
- GraphHeight – Height of the Google Chart
- GraphWidth – Width of the Google Chart
- LicenseServers – Comma delimited list of your license servers
- LicensingTitle – Title for the Licensing part of the Google Chart
- LicensingVendowDaemonPort – Vendor Daemon Port you run licensing on
- LogError – Full Path to Error Log File
- LogHTML – Full Path to HTML Data used to load Google Chart
- LogHTMLOut – Full Path to HTML Output File
- LogVerbose – Full Path to Verbose Log File
- NetScalers – Comma delimited list fo NetScalers
- NetScalerTitle – Title for NetScaler Part of Google Chart
- NetScalervServerTitle – Title for NetScaler vServer Part of Google Chart
- NSPassword – NetScaler Password used for connection
- NSUserName – Username used for NetScaler Connection
- StoreFrontPort – Port you run Citrix StoreFront on
- StoreFrontProtocol – http or https
- StoreFrontServers – Servers that you use to run StoreFront
- StoreFrontTitle – Title for the StoreFront part of the Google Chart
- StorePath – Path to Receiver for Web Site (include initial /)
- TestLicensing – (yes/no) Do you want to test Citrix Licensing
- TestNetScaler – (yes/no) Do you want to test NetScaler and the vServers
- TestStoreFront – (yes/no) Do you want to test StoreFront
- TestXenServer – (yes/no) Do you want to test Citrix XenServer
- XenPassword – Password for your XenServer Pool Masters
- XenPoolMasters – Comma delimited list of XenServer Pool Masters
- XenServerHostTitle – Title for XenServer HOST part of Google Chart
- XenServerManagementPort – Management Port used for XenServer Connections
- XenServerPoolTitle – Title for XenServer POOL part of Google Chart
- XenUserName – Username used to conencto to your XenServer Pool Masters
Once you have your registry configured it should look similar to the below
Set Up The Scripts
Also you will find a scripts directory.
Extract that and put it in the root of your monitoring server. The folder will contain a few ps1 files, here is what they are all for.
- monitor.ps1 – the main script file and the one that you will execute to perform the monitoring
- build-html.ps1 – used to build the output web file
- global.ps1 – all global functions used across multiple monitoring modules
- licensing.ps1 – Licensing Monitoring Module
- netscaler-vserver.ps1 – NetScaler vServer Monitoring Module
- storefront.ps1 – StoreFront Monitoring Module
- xenserver.ps1 – XenServer Monitoring Module
Once extracted you will see the scripts locally on your monitoring server.
NOTE: Make sure the jpg files you specified in your registry config are in the same location as your output html file. In my case I’m going to put the output in the Scripts Directory.
Running The Script
At this point you are ready to test run the script. Open up Powershell (With XenServer SDK Installed if your monitoring XenServer) and run the master script.
You will see the script executing and a verbose output on the Powershell display
Once the script has completed you will see the following in your Powershell window
If you look in your output directory you will see the log files and the html output file. Lets open that up and see what we have
As you can see Its picked up my License Server and tested the Vendor Daemon port as ok, My XenServer Pool is good and the 2 hosts are running, StoreFront and the BrettyWeb Store is up and finally my NetScaler is working and all 12 vServer are up and not Degraded.
Lets Bring some stuff down to make sure it shows this on the dashboard
Firstly I have disabled my ADFS Server so the ADFS vServer is down. I have also added a dummy entry to my StoreFront vServer so that it is only partially up
I have also shut down one of my XenServers in my Lab Pool
So, lets re-run the monitoring script
As you can see it has picked up on some services down. Lets have a look at the monitoring screen now
As you can see its picked up that my XenServer Pool is still ok but one of the hosts is now down. It has also marked on of my vServers as DOWN and alerted on another as degraded but left the service as up.
Getting the Software
Simple – Just drop me an e-mail and I will send you a ShareFile link to the software and scripts. The reason I am asking you to give me your e-mail address is so that I can update and send the scripts as and when they change directly to you, for free. That will keep you up to date and with the latest script files with no hassle on your part.
UPDATE – Added Citrix Director and Citrix Workspace Environment Management to the scripts. As part of the initial download and install you will now get Director and CWEM – for details of the registry keys and whet they do see this article.
Thats it, release one is out there. Better get going with release 2.